Categories
Web analytics

Forwarding UTM parameters from the landing page to another domain.

The client had several one-time landing pages on different domains and wanted to drag traffic to their main website through them. These landing pages did not contain any form, only links to the purchase process on another domain. So evaluating the benefits of individual campaigns was quite a problem, because the data was in several Google analytics properties (services) and the result was only a newsagent from the landing page, but it was no longer possible to link the campaigns to meeting the goals on the main site. For some special reasons, the classic cross domain could not be used.

And that’s why I got the idea to pass UTM parameters to the main site for such simple landing pages.

What does the script do?

The script goes through all the links on the given page and if it finds a link to the main website and it no longer has UTM parameters, then it adds modified UTM parameters through which the visitor came to the given landing page.

Example:

I will come to the page with UTM parameters…
https://landin-page.cz/?utm_source=google&utm_medium=cpc&utm_campaign = campaign-name&utm_term = key-phrase&utm_content=nice-banner

The page has a link:
https://main-web.com/

After running the script, it is adjusted to:
https://main-web.com/?utm_source=landin-page.cz-google&utm_medium=bypass-cpc&utm_campaign=jmeno-kampane&utm_term=klicova-fraze&utm_content=nice-banner

Script features:

  • The script modifies the parameters UTM source and UTM medium, the rest is forwarded without changes. This makes the forwarded traffic known sufficiently recognizable. I am modifying Utm_medium to know that I will not have Google ads ets in this GA for this advertising spend.
  • I added a cookie that will hold UTM for 30 minutes even if the user loses UTM parameters from the URL due to walking through those few microsite pages. This solves the problem of 2-3 pages on the microsite to promote UTM there as well. Limit 30min classic length of GA visit.
  • It is also set there so that UTM parameters are not overwritten if they are already in the URL. So it can be run multiple times and nothing happens.
  • The target domain is set in the script, the URL can also be given there;). So that UTM parameters are not forwarded to places you do not want.

When will it not work?

You use autotagging via gclid in Google ads, so you don’t have the classic UTM parameters in the URL. But it can be bypassed through manual tagging, here you can also put variables such as the name of the campaign, etc. making such manually automated.

What doesn’t it solve?

Organic, I take it as if it is correct if the link remains without modifications and the main page will be a newsagent as a referral given the landing page.

When should you definitely not use it?

If the landing page is on the same domain as the main site. In that case, you should have the same Google analytics ID and not solve anything like that.

Implementation:

In the Google tag manager, insert the following script into the tag and edit the value of “targetdomain” on your main site.

When to run the script?

In the Google tag manager for the DOM ready event. The page will already contain links that can be modified. For a SPA application, the script would go a lot when changing the url / content.
The script does not use any GTM functions, so it can be inserted at the end of the page manually into the code.

.