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

#GTMTips: URL Source In The URL Variable

One of the less-known features of Google Tag Manager, a hidden gem if you will, is the URL Source setting in the URL Variable type. It lets you parse any URL String for its components.

Tip 38: Parse URL strings with the URL Source setting

Parse URL string with URL Source setting
The setting itself is easy to find. Just edit an existing URL Variable, or create a new one. Then, scroll down to the More Settings divider, expand it, and you’ll see the URL Source drop-down list.

This list will list all the Variables in your container, Built-In Variables included, and you can pick the one you want to parse. Note that the Variable you choose needs to return a properly formatted URL string for parsing to work. A properly formatted URL has at least the protocol (e.g. http:// or https://) and hostname (e.g.

Won’t work:

Will work:

The Url Source setting establishes a URL String that is then parsed according to the Component Type setting you chose. In the image above, I’m using the Referrer Built-In Variable, which returns the referrer URL of the page in question, and I’m parsing it just for its path. In other words, this particular URL Variable will return the path of the previous page.

If the referrer is, the Variable will return /about-simo-ahava/.

Quite a useful feature, and often overlooked.

The post #GTMTips: URL Source In The URL Variable appeared first on Simo Ahava's blog.

This post first appeared on Simo Ahava's Blog - What's New In Digital Analytic, please read the originial post: here

Share the post

#GTMTips: URL Source In The URL Variable


Subscribe to Simo Ahava's Blog - What's New In Digital Analytic

Get updates delivered right to your inbox!

Thank you for your subscription