This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Small Snippet to Parse GTM Macros on GTM Debug Interface | |
// Idea From Simo's Post: #GTMTips: The Mysterious .macro() Call In Custom HTML Tags | |
// URL: https://www.simoahava.com/gtm-tips/mysterious-macro-call-custom-html-tags/ | |
// Current Version, does not take care of current variable type, all is replaces as str. | |
(function() { | |
const iframe = document.querySelector('iframe[src="about:blank"]'); | |
iframe.contentDocument.querySelectorAll('.CodeMirror-code').forEach(function(e) { | |
if (e.querySelectorAll('.CodeMirror-line').length > 0) { | |
let _code = [...e.querySelectorAll('pre.CodeMirror-line')].map(function(e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.fetch) | |
fetch('https://www.google-analytics.com/collect').then(function(response) { | |
if (!response.ok) { | |
throw Error(response.statusText); | |
} | |
return response; | |
}).then(function(response) {}).catch(function(error) { | |
window.dataLayer.push({ | |
'event': 'ga-blocked' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON.stringify(obj, function (k, v) { | |
return (v === undefined) ? "undefined" : v | |
}).replace(/\"undefined\"/g,undefined); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getRootDomain = function(domain=document.location.host){ | |
var rootDomain = null; | |
if (domain.substring(0,4)=="www.") { | |
domain=domain.substring(4,domain.length); | |
} | |
var domParts = domain.split('.'); | |
for(var i=1;i<=domParts.length;i++) | |
{ | |
document.cookie="testcookie=1; path=/; domain="+domParts.slice(i*-1).join('.'); | |
if(document.cookie.indexOf("testcookie") != -1){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple dataLayer object observer for Chrome +36 | |
// David Vallejo (@thyng) | |
// 2014 | |
Object.observe(dataLayer,function(e){for(i=0;i<e.length;i++)"add"==e[i].type&&console.table([e[i].object[e[i].object.length-1]])}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelector('iframe[src*="about"]').contentWindow.angular.element(document.querySelector('iframe[src*="about"]').contentWindow.document.querySelector('[ng-app]')).injector().get("$log").debug = function(){}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* Spam Referrals Buster | |
* | |
* author: David Vallejo (@thyng) | |
* version: 0.2 Beta | |
* date: 2015-07-19 | |
* | |
* @link https://www.thyngster.com | |
*/ |
NewerOlder