MozillaFoundation / foundation.mozilla.org

Mozilla Foundation website
https://foundation.mozilla.org
Mozilla Public License 2.0
384 stars 153 forks source link

Schedule.mozillafestival GA4 Setup #10150

Closed phoang0 closed 6 months ago

phoang0 commented 1 year ago

We've created a GTM container for the schedule.mozillafestival now however the snippet below needs to be added to the site before we can proceed any further.

A GA4 property has also been setup (property ID: 353721369) but we need the snippet to be added before any GA4 tags can be published.

Copy the code below and paste it on to every page of your website. Paste this code as high in the of the page as possible:

<!-- Google Tag Manager -->
<script>(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-PB5FRTL');</script>
<!-- End Google Tag Manager -->

Additionally, paste this code immediately after the opening tag:

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PB5FRTL"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
marcwalsh commented 1 year ago

Adding @robb-j here who is the developer from Open Lab - he'll be able to support this.

robb-j commented 1 year ago

Should I also take out the existing GA tracking code?

robb-j commented 1 year ago

I've deployed a version to the staging/development site which you can use to test it is integrated properly? https://mozfest.openlab.dev/plaza

marcwalsh commented 1 year ago

Hey @phoang0 - we've decided to make this change after the festival to avoid any potential data loss for the live event.

phoang0 commented 1 year ago

Hi both, apologies if I'm misreading your messages but I can't seem to find the GTM snippet on the staging site? Thanks

simont-cr commented 6 months ago

Closed per 2024 ticket purge.