Campaign tracking
When tracking a paid, social or email campaign it is best to tag links with parameters that allow website analytics tools to better report on how the campaign performed. When you do this the URL will look like this: https://www.example.com/?utm_source=summer-mailer&utm_medium=email&utm_campaign=summer-sale
You can set up your link parameters using this tool: Campaign URL Builder
From Google’s help page, the essential parameters are utm_source
, utm_medium
and utm_campaign
: URL builders: Collect campaign data with custom URLs
utm_source
Referrer, for example: google, newsletter, billboardutm_medium
Marketing medium, for example: cpc, banner, emailutm_campaign
Product, slogan, promo code, for example: spring_sale
For the utm_medium
parameter, anything which is paid-for (including paid advertising on social media) you should set the value to 'paid'. For non-paid social media links set the value to 'social'. Learn how Google Analytics classifies souce/medium data for channel groupings. We recommend validating URLs with an online validation tool.
We also recommend adding the parameters to any short or ‘vanity’ redirects. For our sites that means adding a redirect from a friendly URL that can be included on something like a print or TV advert (for example, mygov.scot/renters
) which then gets redirected in the back-end of our CMS to a URL which has the tracking code attached, for example:
https://www.mygov.scot/private-rental-rights?utm_source=shorturl&utm_medium=cpc&utm_campaign=renters_rights
Putting utm_source
in the parameter overwrites the referring site source URL and so vanity URLs are best for print/TV where there is no better way to track. In all cases where you use campaign tracking by adding parameters to a URL you should ensure that the full tagged URL contains all of the information that you need.
Ideally any paid advertising ads would be consistently tagged. In Google Ads this can be done through templates which can be set via the account settings "tracking" section.
{lpurl}?utm_source={network}&utm_medium=cpc&utm_id={campaignid}&ad_group_id={a
dgroupid}&ad_id={creative}&placement_id={placement}&gclid={gclid}
Feedback, help and support
If you need help or support you can e-mail us at designsystem@gov.scot
There is a problem
Thanks for your feedback