You are here

santianoCore

description

- Dev & Prod work environments - Double container sanwitch - DomainNameList - To work properly, santiano.io requires your website to have a dataLayer, and Google Tag Manager properly installed.

The Double Container Sandwitch

Websites have test environments, santiano.io have test environments too!

With santianoCore you have one single JSON configuration only that can be integrated in two GTM containers

  • 1 production GTM container Loaded on the production website(s) only

  • 1 development GTM container Loaded on any other environments (localhost / UAT / QA / DEV / you name it)

You want to add a feature to your container and/or website ? This happens in your Dev Container so you can test it easily.

You've tested everything and your developer is ready to push to production ? Well you just have to download your DEV container via the GTM 'Export Container' function and then get to the PROD Container and use the GTM 'Import Container' with 'overwrite function, then click the 'Publish' button.

You don't have to modify anything on your GTM configuration between PROD and DEV as this feature is built-in with santianoCore

setup

Please refer to the container setup instructions

gtm variables

pageHostName

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

  Component Type : Host Name
close
santianoApacheV2.0Licence

santianoApacheV2.0Licence
Variable Type : Custom Javascript

    function() {
  // santiano.io is released under Apache V2.0 licence.
  // 
  // Copyright 2018 Santiano Consulting SAS (santiano.io)
  // 
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  // 
  // http://www.apache.org/licenses/LICENSE-2.0
  // 
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
    return 'santiano.io is released under Apache V2.0 licence';
  }
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
santianoCoreCurrentGtmId

santianoCoreCurrentGtmId
Variable Type : Container ID
Provides us the GTM container ID being loaded at the moment

  no configuration required
close
santianoCoreDoubleContainerSandwitch

santianoCoreDoubleContainerSandwitch
Variable Type : Custom Javascript
Looks at the GTM ids from prod, dev, and current + if santianoCoreWebsiteIsInProduction to know where we are and if there are issues with our current implementation of GTM without having to remember all ids by heart.

  function() {
var santianoCoreWebsiteIsInProduction = {{santianoCoreWebsiteIsInProduction}};
var santianoCoreCurrentGtmId = {{santianoCoreCurrentGtmId}};
var santianoCoreGtmDevId = {{santianoCoreGtmDevId}};
var santianoCoreGtmProdId = {{santianoCoreGtmProdId}};

if (santianoCoreGtmProdId == 'GTM-XXXXXXX') {
	// santianoCoreGtmProdId is not yet defined
  	return '#Issue :( santianoCoreGtmProdId undefined'
  
} else if (santianoCoreGtmDevId == 'GTM-XXXXXXX') {
	// santianoCoreGtmProdId is not yet defined
  	// Only 1 GTM container is assumed
  	return '#OK :) santianoCoreProdId: ' + santianoCoreGtmProdId;

// Now we consider we are in a doubleContainerSandwitch !!!
  // Double GTM Id 
  // Double Analytics 
  // 1 GTM Configuration JSON File managing everything
  // and versionned on two distinct environments
  
// - 1 santianoCoreGtmDevId
  	// the GTM id called by the website on its localhost, Dev, QA, ...
  	// calling the webanalytics tools in their Dev ID
  
// - 1 santianoCoreGtmProdId
  	// the GTM id called by the website in production, serious stuff ;)
  	// sending data to vendors
		// UA-XXXXX Prod - Real revenue and conversions without the devs
  		// Advertising tags
  
// To push the GTM Configuration JSON from Dev to Prod :

    // on gtmDev - Publish, export the JSON, download it
  	// on gtmProd - Import the downloaded JSON, Overwrite, Publish
  	
} else if (santianoCoreWebsiteIsInProduction == true) {

  	// we are on a production website
    if (santianoCoreCurrentGtmId == santianoCoreGtmProdId) {
        // expected setup with the double container sandwitch :
        return '#OK :) - GTM in Prod - Website in Prod';
      
    } else if (santianoCoreCurrentGtmId == santianoCoreGtmDevId) {
  		// We are calling the production website with the dev GTM environment.
      	// call your favorite dev and say hello :)
		return '#Issue :( - GTM in Dev - Website in Prod'; 

    } else {
      	// is the santianoCoreCurrentGtmId correct in the GTM setup ?
		return '#Issue :( - GTMId not recognized - Website in Prod';
	}
  
} else {
	// we are in a dev environment
	if (santianoCoreCurrentGtmId == santianoCoreGtmProdId) {
      	// Issue here as we call the Prod GTM id on the Dev Website
		return '#Issue :( GTM in Prod - Website in Dev';
      
	} else if (santianoCoreCurrentGtmId == santianoCoreGtmDevId) {
      	// Expected as I call GTM from a dev environment with the right GTM ID 
		return '#OK :) - GTM in Dev - Website in Dev';
      
	} else {
      	// the GTM id is not expected it seems...
		return '#Issue :( - GTMId not recognized - Website in Dev';
	}
}
}
close
santianoCoreGtmDevId

santianoCoreGtmDevId
Variable Type : Constant
replace with your GTM ID for Dev environments

  Value : GTM-XXXXXXX

close
santianoCoreGtmProdId

santianoCoreGtmProdId
Variable Type : Constant
Replace with your GTM Production ID

  Value : GTM-XXXXXXX
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

	// santianoCore

var doubleContainerSandwitch = {
'gtmIdDev' : 'GTM-XXXXX',
'gtmIdProd' : 'GTM-XXXXX'
}