Video tutorial · Click IDs, UTMs and first-party data

Store URL parameters in cookies or Local Storage with a GTM template

6 minSeptember 2025By John BernalWatch on YouTube
In shortThe quickest way to save gclid, UTMs or any other URL parameter: the 'URL to Cookies or Local Storage' community template for Google Tag Manager. List the parameters, pick the cookie lifetime or Local Storage, fire it early and check the values are stored.

Chapters

What you need before you start

Steps covered in the video

  1. Create a new tag and pick the template from the Community Template Gallery.
  2. List the URL parameters to save, separated by commas.
  3. Choose the cookie duration, and whether to also use Local Storage.
  4. Fire it as early as possible, on all pages or only when the parameters are present.
  5. Test with a URL that has test values and verify the storage.

Resources

Recorded in September 2025. Some screens may look different today.

JB
John Bernal

Tracking and analytics consultant with 10+ years setting up GA4, Google Tag Manager, server-side tracking and ad platform conversions. Stape partner, Top Rated Plus on Upwork. About AnalyticsEngine

Related videos

Rather have someone set it up and keep it working?

Tracking & Analytics Ops is $500 a month per website. I set up your tracking, check it every day, fix what breaks and answer your analytics questions. AI does the daily checks; I make every decision.