Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Google Tag Manager: How to create a cookie

Creating a Cookie in Google Tag Manager is very easy.

  1. Create a custom HTML tag
  2. Insert the cookie script below and update the following values to suit your needs:
    1. Name (name of the cookie, which can be anything you want)
    2. Value (the value the cookie should hold)
    3. Days (how many days until the cookie expires)
  3. Create the trigger i.e.  when should the cookie be created
  4. Publish and you’re done. Super Easy!

Code to create a cookie

You can see the cookie n Chrome Developer Tools / Application (tab).

To get the value of a cookie in Google Tag Manager we can create a

Custom Variable  / Page Variable / 1st Party Cookie

And set to the name of the cookie you want to get the value for.

Now that you have the cookie value in a custom variable you can use it anywhere in Google Tag Manager.

And that’s it for creating a cookie and getting a cookie value in Google Tag Manager.

The post Google Tag Manager: How to create a cookie appeared first on Kev Thomson.

This post first appeared on Digital Marketing Measurement & Insight, please read the originial post: here

Share the post

Google Tag Manager: How to create a cookie


Subscribe to Digital Marketing Measurement & Insight

Get updates delivered right to your inbox!

Thank you for your subscription