Skip to content

Instantly share code, notes, and snippets.

@geramirez
Created February 8, 2016 18:51
Show Gist options
  • Save geramirez/88eb828c5cf7376436f8 to your computer and use it in GitHub Desktop.
Save geramirez/88eb828c5cf7376436f8 to your computer and use it in GitHub Desktop.
AnalyticsCheckerScript
var data = {'UACodes': []};
var gaUniversal = window.ga;
if (typeof gaUniversal === "function") {
gaUniversal.getAll().map(function (element){
data['UACodes'].push({
version: 'Google Analytics Universal',
trackingId: element.get('trackingId'),
anonymizeIp: element.get('anonymizeIp'),
forceSSL: element.get('forceSSL')
})
});
}
if (window.oCONFIG) {
data['DAP'] = {
agency: oCONFIG['AGENCY'],
ua_codes: oCONFIG['GWT_UAID'],
sub_agnecy: oCONFIG['SUB_AGENCY'],
version: oCONFIG['VERSION'],
};
}
console.log(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment