At Stormly we make it easy for you to integrate with Google Tag Manager, while allowing you to fully customize what you track.
Here's how to get started with tracking custom events using GTM.
First create a custom tag, by follow the steps below:
Stormly – General Library – All Pages
Custom HTML
Setup Data
on the current project. The code looks something like this:
<script type="text/javascript">(function(e,t,n,r,i,s,o){e["StormlyObject"]=i;e[i]=e[i]||function(){(e[i].q=e[i].q||[]).push(arguments)},s=t.createElement(n),o=t.getElementsByTagName(n)[0];s.async=1;s.src=r;o.parentNode.insertBefore(s,o)}) (window,document,"script","//cdn.stormly.com/assets/tracking/t.js","stormly"); stormly("create", "YOUR_STORMLY_KEY", {domain: "tt7bxiq.t.stormly.com", anonymizeIP: false, storeOnlyOneCookie: true}); </script>
Once per Page
All Pages
default triggerThe next step is to track the actual behavior events. In the example below, we will trigger a tracking event on a link click.
Triggers
from the left menu in tag managerJust Links
Page path
and Click ID
have to be customized to your own page structure and element IDs:Now we will create the link click tag, that will send data to Stormly. Follow the steps below to create the tag.
<script>stormly("event", "Item Read More", {category: "tutorial", words: 800});</script>
Advanced settings
> Tag sequencing
and select the Stormly library to fire before the event tag.Today
, otherwise no results are available
Repeat this process for all other event behaviors that you'd to track, and you're set!
Note: Tracked data becomes available in Stormly within seconds usually, but new projects become "active" only once at least 50 unique users are tracked.
There are two other tracking functions that you can use, but are not required:
<script>stormly("set", {favoriteColor: "blue", favoriteHolidayDestination: "Spain"});</script>
<script>stormly("identify", "user-12345");</script>