Google Tag Manager
to add peasy to your Google Tag Manager project, follow the steps below:
<script>
var script = document.createElement('script');
script.src = "https://cdn.peasy.so/peasy.js";
script.async = true;
script.id = 'peasy-script';
script.dataset.website-id = '<website_id>';
document.getElementsByTagName('head')[0].appendChild(script);
</script>
- copy the snippet above, replacing
<website_id>
with your website id found in your dashboard. - go to GTM and create a new tag and select Custom HTML tag type.
- paste your script into the HTML field.
- click on the
Triggering
section and set triggering toAll pages
. - name your tag, save and publish your container.
that's it! peasy will now start tracking user interactions on your website.
next steps
learn how to track custom events in the custom events documentation.