Sha256: 15531b21f33683a0cd70c5f57a384cc0e184d18a51b83b5f580b9a22e49a85dd
Contents?: true
Size: 804 Bytes
Versions: 27
Compression:
Stored size: 804 Bytes
Contents
var old_url = window.location.href; var first = true; document.addEventListener("turbolinks:load", function() { //console.log("analytics load"); if (first) { first = false; return; } if (window.metrika && window[metrika] && window[metrika].hit) { window[metrika].hit(window.location.href, document.title, old_url) } old_url = window.location.href if (window.gtag) { gtag('event', 'page_view'); //gtag('event', 'page_view', { 'send_to': 'YOUR_ID_HERE' }); } }); export default function(name) { if (window.metrika && window[metrika] && window[metrika].reachGoal) { window[metrika].reachGoal(name); } else { if (window.console) { console.log('unable to send event - no metrika'); } } //if (window.gtag) { //gtag('event', name); //} };
Version data entries
27 entries across 27 versions & 1 rubygems