You are here

santianoClicks

description

Let's have a look at the clicks occuring on our website, internal, interdomain, and objviously external clicks 

setup

Please refer to the container setup instructions

gtm tags

santianoEvent - Click on External Link

santianoEvent - Click on External Link
Tag Type : Custom HTML
Sends a santianoEvent when the click is going external

  <script>
dataLayer.push({
	'event': 'santianoEvent', 
    'eventCommand': 'clickExternalLink',
	'eventCategory': 'Click on External Link', 
	'eventAction': {{clickUrl}},
	'eventLabel': {{pageUrl}}
	// 'eventSegment': undefined,
	// 'eventPartition': undefined
               });
</script>
close
santianoEvent - Click on Internal Link

santianoEvent - Click on Internal Link
Tag Type : Custom HTML
Sends a santianoEvent for every Internal link clicked on the site

  <script>
dataLayer.push({
	'event': 'santianoEvent', 
    'eventCommand': 'clickInternalLink',
	'eventCategory': 'Click on Internal Link', 
	'eventAction': {{clickUrl}},
	'eventLabel': {{pageUrl}}
	// 'eventSegment': undefined,
	// 'eventPartition': undefined
});
</script>
close
santianoEvent - Click on IntraDomain Link

santianoEvent - Click on IntraDomain Link
Tag Type : Custom HTML
Sends a santianoEvent for every click occuring outside our current domain but inside our domain name lists to track

  <script>
dataLayer.push({
	'event': 'santianoEvent',
  	'eventCommand': 'clickIntraDomain',
	'eventCategory': 'Click on IntraDomain Link', 
	'eventAction': {{clickUrl}},
	'eventLabel': {{pageUrl}},
	// 'eventSegment': undefined,
	// 'eventPartition': undefined
});
</script>
close

gtm triggers

Click on External Links

Click on External Links
Trigger Type : Click - Just Links
The click is going to an external website
clickIsExternal equals true

close
Click on Internal Links

Click on Internal Links
Trigger Type : Click - Just Links
the click is going on the same hostname
clickIsInternal equals true

close
Click on IntraDomain Links

Click on IntraDomain Links
Trigger Type : Click - Just Links
Very usefull for multidomain /multi-subdomain tracking
clickIsIntraDomain equals true

close

gtm variables

clickHostName

clickHostName
Variable Type : Auto Event Variable
Provides the hostname of the destination of a click

  Variable Type : Element URL
Component Type : Host Name

close
clickIsExternal

clickIsExternal
Variable Type : Custom Javascript
Returns true if the Click is External

  function() {
    var websiteIsInProduction = {{santianoCoreWebsiteIsInProduction}};
	if (websiteIsInProduction) {
      	var productionDomainNamesList = {{santianoCoreAuthorizedDomainNamesList}};
		var clickHostName = {{clickHostName}};
		if ( productionDomainNamesList.indexOf(clickHostName) == -1) {
        	return true
        } else {
          	return false  
        }
	} else {
  		return false
    }
}
close
clickIsInternal

clickIsInternal
Variable Type : Custom Javascript
Returns true if the click destination hostname is internal

  function() {
    var websiteIsInProduction = {{santianoCoreWebsiteIsInProduction}};
	if (websiteIsInProduction) {
      	var pageHostName = {{pageHostName}};
		var clickHostName = {{clickHostName}};
		if ( pageHostName == clickHostName ) {
        	return true
        } else {
          	return false  
        }
	} else {
  		return false
    }
}
close
clickIsIntraDomain

clickIsIntraDomain
Variable Type : Custom Javascript
Returns true if the destination of that click is not internal to our domain but in our santianoCoreWebsiteIsInProduction

  function() {
    var websiteIsInProduction = {{santianoCoreWebsiteIsInProduction}};
	if (websiteIsInProduction) {
      	var productionOtherDomainNamesInternal = {{santianoInternalOtherDomainNames}};
		var clickHostName = {{clickHostName}};
		if ( productionOtherDomainNamesInternal.indexOf(clickHostName) != -1) {
        	return true
        } else {
          	return false  
        }
	} else {
  		return false
    }
}
close
clickUrl

clickUrl
Variable Type : Auto Event Variable

  Variable Type : Element URL
Component Type : Full URL

close
pageHostName

pageHostName
Variable Type : URL
Providing the hostname of the page being loaded to the user

  Component Type : Host Name
close
pageUrl

pageUrl
Variable Type : URL
Provides the URL of the page being loaded

  Component Type : Full URL
close
santianoClicksIntraDomainNamesList

santianoClicksIntraDomainNamesList
Variable Type : Custom Javascript
if in production, removes the current hostname to have the list of intraDomain hosts

  function() {
    var websiteIsInProduction = {{santianoCoreWebsiteIsInProduction}};
	if (websiteIsInProduction) {
      	var pageHostName = {{pageHostName}};
		var productionOtherDomainNamesInternal = {{santianoCoreAuthorizedDomainNamesList}};
		var pageHostNameIndex = productionOtherDomainNamesInternal.indexOf(pageHostName);
      	productionOtherDomainNamesInternal.splice(pageHostNameIndex, 1);
		return productionOtherDomainNamesInternal;
    } else {
    	return undefined;
    }
}
close
santianoCoreAuthorizedDomainNamesList

santianoCoreAuthorizedDomainNamesList
Variable Type : Custom Javascript
Provides a JS array of all production domain names expected to be tracked

  function() {
  // Replace with the list of all Production Domain Names for your own setup
  // remember to include all the domains with their appropriate subdomain
  var santianoCoreAuthorizedDomainNamesList = ['santiano.io', 
                                               'garylemasson.com', 
                                               'www.garylemasson.com', 
                                               'analytics.google.com', 
                                               'tagmanager.google.com'];
  return santianoCoreAuthorizedDomainNamesList;
}

close
santianoCoreWebsiteIsInProduction

santianoCoreWebsiteIsInProduction
Variable Type : Custom Javascript
Grabs santianoCoreAuthorizedDomainNamesList and pageHostName and returns true if we are in Production

  function() {
  var pageHostName = {{pageHostName}};
  var santianoCoreAuthorizedDomainNamesList = {{santianoCoreAuthorizedDomainNamesList}};
  if (santianoCoreAuthorizedDomainNamesList.includes(pageHostName) ) {
    return true
  } else {
    return false
  };
}
close

Add comment

Download