It is now possible to use Google Tag Manager to track events.
Importing the tag template
The ShinyStat™ event detection tag template is not yet available in the Google Tag Manager template gallery. For this reason it must be imported manually by following the procedure described below:
1. Download the template template (template.tpl) from this link (you can directly save the file by right-clicking and selecting "Save link as...").
2. In Google Tag Manager, click on "Templates" in the left menu and then on "New" in the "Tag templates" box.
3. In the template editor, import the previously saved "template.tpl" file by clicking on the button with the three vertical dots and then on "Import".
4. Click on "Save" and then on the [x] on the left.
Configuring the tag for tracking an event
Now the model is ready to be used. Here are the steps required to set up event tracking:
1. Make sure you have already created the tag containing the ShinyStat™ tracking code as explained in the guide.
2. In Google Tag Manager, click on "Add a new tag".
3. Click on the box "Choose a tag type to start the installation..."
4. Select the custom template "ShinyStat Analytics - Events tracking" from the list
5. Give the tag a name (top left) and configure the details of the event you want to track.
6. Configure a trigger. The trigger is needed to determine when the event should be sent. For example, you can choose whether to send an event on each page view, or in response to a click. For details on configuring a trigger, refer to the Google Tag Manager guide.
7. Make sure the event detection tag runs after the ShinyStat™ tracking code tag. This is especially necessary when the event needs to be traced immediately on page load, as is the case with the "All pages" trigger. To do this, click on the "Tag configuration" box. In "Advanced Settings", turn on the "Tag Sequence" as shown.