Home Analytics #GTMTips: The URL Parser Variable Template For Server Containers

#GTMTips: The URL Parser Variable Template For Server Containers

by datatabloid_difmmk

Server-side tagging allows any kind of HTTP request to be sent to the server container. The Server container parses these and launches container instances to send data to first party data stores and third party vendors alike.

These requests often contain a URL string encoded with query parameters. A typical example is document location Parameters for Universal Analytics requests.

server side client Parse these URL strings and convert them to the required format. event data object.

If one of the fields in the event data object is page_location, which typically encodes the URL of the page from which the request originated. Parsing this field is difficult without a dedicated variable template, so URL parser A variable template for the server container.

The variable template user interface is URL variables Built into GTM’s web container. The main difference is that URL source From the beginning.default is page_location Fill in the fields, but you can provide a valid URL string from any source (such as other parameters of an incoming HTTP request).


X


shimmer newsletter

Subscribe to our Simmer newsletter to receive the latest news and content from Simo Ahava right in your email inbox!

Tip 125: Server container URL parser variable template

URL parser template for server container

the template is Community template gallery. To download server containerdo the following:

  1. go to template In the Google Tag Manager server container where you add the URL parser variable template.
  2. click Search gallery next to variable template box.
  3. Search for URL parser gallery template.
  4. click Add to workspace Add to container.

Add to workspace template

After successfully adding it to your workspace, you can navigate to: variable Click to create a new variable. For variable types, URL parsermust be listed among the available custom templates.

The variable itself is URLs Variables in the web container.

for example, page_location If the event data field is set to this URL string, the following table shows the possible return values ​​for the variable depending on what you choose in the options.

https://www.mydomain.com/some-path/file.html?queryParameter=parameter_value#some-hash-fragment

Component type setting Return value
filename extension none html
piece none some-hash-fragment
Full URL none https://www.mydomain.com/some-path/file.html?queryParameter=parameter_value#some-hash-fragment
hostname Strip “www.” not yet verified www.mydomain.com
hostname Strip “www.” already checked mydomain.com
road none /some-path/file.html
port none none
protocol none https
query query key Unset queryParameter=parameter_value
query query key set to queryParameter parameter_value

We hope you found the template helpful. A primary use case is to extract query parameters such as ad click IDs (think of it). fbclid, gclid), decorating the tag’s outgoing payload with this metadata.

You may also like

Leave a Comment

Subscribe my Newsletter for new blog posts, tips & new photos. Let's stay updated!

About Us

We're a provider of Data IT News and we focus to provide best Data IT News and Tutorials for all its users, we are free and provide tutorials for free. We promise to tell you what's new in the parts of modern life Data professional and we will share lessons to improve knowledge in data science and data analysis field.

Facebook Twitter Youtube Linkedin Instagram

5 Strategies To Reduce IT Support Tickets – Ultimate Guide

Recent Articles

Redefining the Role of IT in a Modern BI World What (Really) Are Issues Faced by Data Scientist in 2022 How I start Data Science Projects | What to do when you're stuck

Featured

5 Strategies To Reduce IT Support Tickets – Ultimate Guide Redefining the Role of IT in a Modern BI World What (Really) Are Issues Faced by Data Scientist in 2022

Copyright ©️ All rights reserved. | Data Tabloid