Skip to content

Instantly share code, notes, and snippets.

View Glis's full-sized avatar
🦥
Todo va a estar bien

Jorge Fuentes Glis

🦥
Todo va a estar bien
View GitHub Profile
@Glis
Glis / whitelabel-share-clientid.js
Last active December 15, 2021 03:55
[LOCAL][WL-PARENT] Share GA ClientID script
(function() {
// Universal Analytics tracking ID whose _ga cookie to use.
// If using GA4, you can leave this setting untouched.
var trackingId = 'UA-209071318-1';
// Maximum time in milliseconds to wait for GA tracker to load.
// Again, irrelevant for GA4.
var maxGATime = 2000;
// Set to the origin ("https://www.domain.com") of the iframe you want to communicate with
@Glis
Glis / iframe-receive-clientid.js
Last active October 26, 2021 20:10
[LOCAL][IFRAME] Receive GA ClientID script
(function() {
// If not in iframe, do nothing
try {
if (window.top === window.self) return;
} catch(e) {}
// Set to false to prevent dataLayer messages from being sent to parent
var sendDataLayerMessages = false;
// Set the prefix that will be used in the event name, and under which all
@Glis
Glis / 0_reuse_code.js
Created November 8, 2016 19:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console