UTM Capturing and Storing in Cookies

  Attribution

This Javascript code automatically captures UTM parameters of your website visitors.
It captures both first and last interactions and storing the data in the browser cookies for 365 days (see: cookieExpiryDays variable in the code).

Learn more about our Multi-Touch Attribution solution

Important

  1. There are 2 versions of the script, one is minified (without the comments and spaces) and the original. It’s recommended to use the minified version.
  2. If you install the script using Google Tag Manager, you should create a new Custom HTML container, first add <script>THE_CODE_GOES_HERE</script>, then paste the code between the 2 script tags.

Need help or have any questions? We’d be happy to assist 🙂

First Touch Cookies:
__ft_referrer
__ft_utm_campaign
__ft_utm_content
__ft_utm_medium
__ft_utm_source
__ft_utm_term

Last Touch Cookies:
__lt_referrer
__lt_utm_campaign
__lt_utm_content
__lt_utm_medium
__lt_utm_source
__lt_utm_term

 

Related post: Marketing Attribution Tracking in Marketo – Aren’t You Forgetting Something?

 

Source Code

Minified

Full

One Reply to “UTM Capturing and Storing in Cookies”

LEAVE A COMMENT