
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
- Publisher access in Google Tag Manager
Steps covered in the video
- Create a new tag and pick the template from the Community Template Gallery.
- List the URL parameters to save, separated by commas.
- Choose the cookie duration, and whether to also use Local Storage.
- Fire it as early as possible, on all pages or only when the parameters are present.
- Test with a URL that has test values and verify the storage.
Resources
Recorded in September 2025. Some screens may look different today.
Related videos
3:06Capture the Google Ads gclid in a first-party session cookie
Save the gclid on the first page so you can use it later.
August 2024
4:28Add the Google Ads gclid to outbound links
Pass the gclid to the next domain through your links.
August 2024
12:31Store UTM parameters in first-party cookies with Google Tag Manager
Keep UTMs after the first page, for your CRM and GA4.
February 2024