Skip to content

Instantly share code, notes, and snippets.

View mindbreaker's full-sized avatar

Tom mindbreaker

View GitHub Profile
@mindbreaker
mindbreaker / CookieBot.html
Created April 18, 2024 10:48
Cookie Bot integration with GTM only loads statistics or marketing
<!-- Google Consent Mode -->
<script data-cookieconsent="ignore">
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments)
}
gtag("consent", "default", {
ad_personalization: "denied",
ad_storage: "denied",
ad_user_data: "denied",
@mindbreaker
mindbreaker / matomo-debug.js
Last active May 7, 2020 10:04
Show and hide matomo debug console. Bookmarklet here: [Bookmarklet](https://codepen.io/mindbreaker/full/abvqPeX)
var x = document.getElementById("mtmDebugFrame");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
@mindbreaker
mindbreaker / keybase.md
Created September 11, 2019 09:44
keybase.md

Keybase proof

I hereby claim:

  • I am mindbreaker on github.
  • I am mindbreaker (https://keybase.io/mindbreaker) on keybase.
  • I have a public key ASBSlMziIrh08_hgtBR4XAYwZ235c50gY2oRJUzf486M1go

To claim this, I am signing this object:

Robots Exclusion Protocol

  • Seit 25 Jahren ist REP als Draft-Mode verfügbar
  • Google möchte REP zum Internet-Standard machen
  • Jede Suchmaschine hat hierzu unterschiedliche Varianten implementiert

Im allgemeinen geht es darum, nicht dokumentierte Szenarien festzuhalten:

  • Jedes Übertragungsprotokoll, das auf URIs (Uniform Resource Identifiern) basiert, kann eine robots.txt verwenden. Dazu gehört nicht nur HTTP, sondern zum Beispiel auch FTP oder CoAP.
  • Entwickler / Suchmaschinen müssen mindestens 500 Kilobytes einer robots.txt parsen.
  • Eine neue maximale Obegrenze für das Caching von 24 Stunden gibt Webseitenbetreibern die Möglichkeit, ihre robots.txt flexibel anzupassen. Gleichzeitig überfordern Crawler die Websites nicht mit Anfragen an die robots.txt.
@mindbreaker
mindbreaker / gsc-url-export.js
Last active June 14, 2018 11:58
Fast export URLs from new GSC
document.querySelectorAll("content .zRhise span").forEach(function(e) {
var title = e.getAttribute("title");
if(title)
console.log(e.getAttribute("title"));
});
{"uses":100}
var BounceBooster={debug:false,ref:"",rules:[{id:"google",condition:function(){return/www\.google\./i.test(BounceBooster.ref)}},{id:"yahoo",condition:function(){return/search\.yahoo\.com/i.test(BounceBooster.ref)}},{id:"bing",condition:function(){return/www\.bing\.com/i.test(BounceBooster.ref)}},{id:"facebook",condition:function(){return/facebook\.com/i.test(BounceBooster.ref)}},{id:"twitter",condition:function(){return/t\.co/i.test(BounceBooster.ref)}},{id:"google_plus",condition:function(){return/plus\.url\.google\.com/i.test(BounceBooster.ref)}},{id:"youtube",condition:function(){return/youtube\.com/i.test(BounceBooster.ref)}},{id:"tumblr",condition:function(){return/tumblr\.com/i.test(BounceBooster.ref)}},{id:"instagram",condition:function(){return/instagram\.com/i.test(BounceBooster.ref)}},{id:"default",condition:function(){if(BounceBooster.ref.length>0){var a=new RegExp("^"+location.protocol+"//"+location.host,"i");return !a.test(BounceBooster.ref)}return true}}],init:function(b){BounceBooster.findRefer
@mindbreaker
mindbreaker / file-extension.js
Last active July 26, 2017 10:03
Google Tag Manager Variablen fürs Download-Tracking: Dateiname (katalog.pdf) und Dateierweiterung (pdf)
function() {
return {{Click URL}}.split('.').pop();
}
@mindbreaker
mindbreaker / gtm.js
Created July 18, 2017 13:51
Google Tag Manager externes JavaScript File
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');
@mindbreaker
mindbreaker / headline-tester.js
Last active May 10, 2017 08:50
H1 - H6 Headline Tester
$("h1,h2,h3,h4,h5,h6").each(function() {
console.log(Array(parseInt($(this).prop("localName").substring(1,2))*2).join("-") + " " + $(this).prop("localName") + " " + $(this).text().trim());
})