Google Tag Manager – Overall

Global site tag (gtag.js)

https://www.site24x7.com/tools/url-splitter.html

https://developers.google.com/gtagjs/devguide/linker


Javascript so the linker comes after other info you want on url

adding a parameter to a url that already contains a parameter
https://stackoverflow.com/questions/6953944/how-to-add-parameters-to-a-url-that-already-contains-other-parameters-and-maybe

https://stackoverflow.com/questions/39144511/passing-query-parameters-in-a-cross-domain-tracking-setup

Set up decorate link tag in gtm: https://support.google.com/tagmanager/answer/6164469?rd=2&visit_id=637400640663815525-1646869487

https://stackoverflow.com/questions/52697577/add-parameters-on-href-url-with-javascript-and-with-specific-conditions/52697797

[code]

<html>
<script>
var simpleText = "hello_world";
var finalSplitText = simpleText.split("_");
var splitText = finalSplitText[0];

window.onload = function() {
//when the document is finished loading, replace everything
//between the <a …> </a> tags with the value of splitText
document.getElementById("myLink").innerHTML=splitText;
}

</script>

<body>
<a id="myLink" href = test.html></a>
</body>
</html>

[/code]

https://www.geeksforgeeks.org/how-to-add-a-parameter-to-the-url-in-javascript/
[code]
<!DOCTYPE HTML>
<html>
<head>
<title>
How to add a parameter to the URL
</title>
</head>

<body style = "text-align:center;">

<h2 style = "color:green;" >
GeeksForGeeks
</h2>

<p id = "GFG_UP" style =
"font-size: 15px; font-weight: bold;">
</p>

<button onclick = "GFG_Fun()">
Add Parameter
</button>

<p id = "GFG_DOWN" style =
"color:green; font-size: 20px; font-weight: bold;">
</p>

<script>
var up = document.getElementById(‘GFG_UP’);
var url = new URL("https://www.geeksforgeeks.org");
up.innerHTML = url;
var down = document.getElementById(‘GFG_DOWN’);

function GFG_Fun() {
url.searchParams.append(‘param_1’, ‘val_1′);
down.innerHTML = url;
}
</script>
</body>
</html>

[/code]

var UserIDToUse

[code language=”php”]
<div class="QreelMonthJoin">
<a onclick="javascript:addURL(this); window.open(url);" href="https://join.nakedsword.com/signup/upsellplus.php?site=1&username="><img src="https://nakedsword.com/nakedsword_now/img/Qreel_freemonth_1015x125_02.jpg" border="0" width="100%"></A>
</div><!– // QreelMonthJoin –>

<div ID="AccountDetailPageInfo">
<nsfAccount:AccountDetail runat="server" id="MyAccount" /><!– shows acct details so we can grab em –>
</div><!– // AccountDetailPageInfo –>

<script type=’text/javascript’>

function addURL(element)
{

var UserIDToUse = $(‘.AccountSignInfo’).text();
UserIDToUse=UserIDToUse.replace(/\ /gi,”);
$(element).attr(‘href’, function() {
return this.href + UserIDToUse;
});
}

</script>

[/code]

v2

[code language=”php”]

<div class="QreelMonthJoin">
<a href="https://join.nakedsword.com/signup/upsellplus.php?site=1&username=" onclick="location.href=this.href+’?key=’+UserIDToUse;return false;">Link</a>

<a onclick="javascript:addURL(this); window.open(url);" href="https://join.nakedsword.com/signup/upsellplus.php?site=1&username="><img src="https://nakedsword.com/nakedsword_now/img/Qreel_freemonth_1015x125_02.jpg" border="0" width="100%"></A>
</div><!– // QreelMonthJoin –>

[/code]
https://join.nakedsword.com/signup/upsellplus.php?site=1&username=shawn

BAD
https://join.nakedsword.com/signup/upsellplus.php?site=1&username=&_ga=2.165944573.2111573298.1604301230-2088983423.1604127249shawn

https://www.geeksforgeeks.org/how-to-create-query-parameters-in-javascript/?ref=lbp
https://www.geeksforgeeks.org/how-to-add-a-parameter-to-the-url-in-javascript/

https://stackoverflow.com/questions/975050/passing-javascript-variable-to-a-href
If you want it to be dynamic, so that the value of the variable at the time of the click is used, do the following:


Link
Of course, that’s the quick and dirty solution. You should really have a script that after DOM load adds an onclick handler to all relevant elements.


2 minute max time to complete cross domain visits

2 minutes doesn’t have to do with sessions – it’s the expiration of the linker parameter, and it can’t be modified.


Cross Domain Tracking in Google Analytics – Complete Guide

https://www.optimizesmart.com/cross-domain-tracking-in-universal-analytics-demystified/

GGL > Analytics > Measurement > Universal Analytics (gtag.js)

https://developers.google.com/analytics/devguides/collection/gtagjs/cross-domain

  • https://www.analyticsmania.com/hub/for-gtm-beginners/
  • https://www.analyticsmania.com/hub/gtm-intermediate/
  • https://www.analyticsmania.com/hub/advanced-gtm

Troubleshooting>

https://www.simoahava.com/analytics/troubleshooting-cross-domain-tracking-in-google-analytics/

https://www.thyngster.com/cross-domain-tracking-with-clean-urls

https://developers.google.com/analytics/devguides/collection/gtagjs/cross-domain

\1. **Google Analytics Object** will be created
\2. It will process the linker parameter, overriding the current landing domain clientId value as long as the **linkerParam** value is legit
\3. After that the current page URL will be changed for the same URL but with the **_ga parameters stripped out**.

https://www.thyngster.com/tools/gtm-debug-extension

# Google Tag Manager and Google Analytics Debug Extension

**GTM Debug Extension** is a **Chrome Extension** to ease the task of **debugging Google Tag Manager** and **Google Analytics Implementations**. It’s focused on providing the most data possible and in the best readable format.

[**Click HERE to install the extension**](https://chrome.google.com/webstore/detail/ilnpmccnfdjdjjikgkefkcegefikecdc)

## Included Features:

– View all dataLayer pushes
– Copy dataLayer details to clipboard in a formatted way
– View the current dataLayer model details for each dataLayer push
– View all Universal Analytics Hits sent by pages
– Filter the hits by their type and property ids
– View the Enhanced Ecommerce Data in a visual and sortable way, no more wasting of time trying to decryp the hits payloads
– Check the hit payload size, type, method and if it’s contains any Enhanced Ecommerce data without needing to dig around the request headers and payload.
– Added a message alert to let the users know they have to reload the page on the first extension load
– More to come …

Scroll to Top