Skip to content

Instantly share code, notes, and snippets.

@scips
Last active May 14, 2019 19:04
Show Gist options
  • Save scips/2989fbfd47f32cc855cc to your computer and use it in GitHub Desktop.
Save scips/2989fbfd47f32cc855cc to your computer and use it in GitHub Desktop.
var googleItems = [];
if(_gaq_account) {
googleItems.push('Google Analytics: '+_gaq_account);
}
if(typeof ga === 'function') {
ga(function(){
var trackers = ga.getAll();
for (var i=0; i < trackers.length; ++i) {
var tracker = trackers[i];
googleItems.push("Analytics Universal: "+tracker.get('trackingId'));
}
});
}
if(googleItems.length > 0){
var googleDiv = document.createElement('div');
googleDiv.style = "z-index:999; position: absolute; top: 5px; left: 5px;";
googleDiv.innerHTML = googleItems.join('<br>\n');
document.body.insertBefore(googleDiv, document.body.lastChild);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment