Skip to content

Commit

Permalink
Add more analytics script examples to sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
replete committed Jun 22, 2024
1 parent b9c0ad8 commit 5fc5c49
Showing 1 changed file with 69 additions and 2 deletions.
71 changes: 69 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,75 @@
console.log('Matomo loaded:', !!Matomo) // only available once loaded
</script>

<!-- hotjar analytics -->
<script type="text/plain" data-consent="analytics" id="js-analytics-hotjar">
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:000000,hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>

<!-- mixpanel analytics -->
<script type="text/plain" data-consent="analytics" id="js-analytics-mixpanel">
(function(f,b){
if(!b.__SV){
var e,g,i,h;
window.mixpanel=b;
b._i=[];
b.init=function(e,f,c){
function g(a,d){
var b=d.split(".");
2==b.length&&(a=a[b[0]],d=b[1]);
a[d]=function(){
a.push([d].concat(Array.prototype.slice.call(arguments,0)))
}
}
var a=b;
"undefined"!==typeof c?a=b[c]=[]:c="mixpanel";
a.people=a.people||[];
a.toString=function(a){
var d="mixpanel";
"mixpanel"!==c&&(d+="."+c);
a||(d+=" (stub)");
return d
};
a.people.toString=function(){
return a.toString(1)+".people (stub)"
};
i="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(h=0;h<i.length;h++)g(a,i[h]);
b._i.push([e,f,c])
};
b.__SV=1.2;
e=f.createElement("script");
e.type="text/javascript";
e.async=!0;
e.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===f.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";
g=f.getElementsByTagName("script")[0];
g.parentNode.insertBefore(e,g)
}
})(document,window.mixpanel||[]);
mixpanel.init("FAKE_TOKEN");
</script>

<!-- misc analytics -->
<script id="js-analytics-misc" data-consent="analytics" type="text/plain">
<script type="text/plain" data-consent="analytics" id="js-analytics-misc">
console.log('analytics consent granted: This script will be inserted when analytics consent is granted')
</script>

<script type="text/plain" data-consent="analytics" id="js-analytics-klaviyo-setup">
var _learnq = _learnq || [];
_learnq.push(['identify', {
// Change the line below to dynamically print the user's email.
'$email' : '{{ email }}'
}]);
</script>
<script type="text/plain" data-consent="analytics" src="https://static.klaviyo.com/onsite/js/klaviyo.js" id="js-analytics-klaviyo"></script>

<script>
biscuitman = {
message: 'By clicking "Accept All", you agree to the use of cookies for improving browsing, providing personalized ads or content, and analyzing traffic. {link}',
Expand All @@ -80,7 +144,10 @@
'sc_medium_source': 'Statcounter uses this to store the referring website',
'statcounter.com/localstorage/': 'Statcounter uses this to count',
'_pk_*': 'Matomo/Piwik analytics',

'_hj*': 'Hotjar analytics',
'mp_*': 'Mixpanel analytics',
'_kvyo_*': 'Klaviyo analytics',
'__kla_id': 'Klaviyo analytics'
},
performanceTitle: 'Performance',
performanceMessage: 'Performance cookies allow us to understand critical website performance indicators, contributing to an enhanced user experience for visitors',
Expand Down

0 comments on commit 5fc5c49

Please sign in to comment.