You deployed Screeb through Google Tag Manager and you would like to be able to track events to choose when to display your surveys? It's possible! Here's how:
1️⃣ Tracking events at page load
This is the most simple way to track events in Google Tag Manager.
Go to your Screeb account, and click on Settings and then on Install Screeb.
Here, you'll find the Event Tracking code.
The code you can copy is an example. You'll be able to customize it in Google Tag Manager.
Go to Google Tag Manager, and create a new Custom HTML tag.
<script> tags around it.
In this example, we'll track every page viewed. So rename the event from 'Product added to cart' to 'Page Viewed.
For now, properties are not handled in Screeb so you may remove them, or use them to prepare a future support.
Since we are using multiple tags in Google Tag Manager (the event tracking one and the main Screeb one), you'll need to sequence them correctly. We need the main tag to be fired before the event tracking one for it to work.
So click on Advanced Settings and then on Tag Sequencing.
Choose the Fire a tag before Event Page Viewed fires option
And select your Screeb main tag.
To finish, you'll need to link a trigger to your tag to decide when you want it to be fired. In our example, we want it to be fired at page load so we'll use the Page View trigger.
Click on Triggering, and then on All Pages.
Click on Save and Submit your modifications for them to be live.
Now, go back to Screeb, click on Settings and Visitor Events. Here, you'll see your brand new event and the number of times it's been fired. It means that the event is well tracked.
2️⃣ Tracking Clicks through Google Tag Manager
Now, let's say you want to track a click on a button.
You need to start by deploying a generic All Elements click trigger in Google Tag Manager. So, go back to Google Tag Manager, click on Triggers, and add a new Trigger.
Give it a name and select "All Elements" as trigger type.
Save it and submit your changes.
Now, if you go in the Preview Mode of Google Tag Manager, you'll see all the Variables sent to GTM for every click event.
To be able to use the clicks on those variables as triggers, you need to go to Variables and then to Configure. There, select every built-in click variables.
Now, you'll be able to trigger a tag based on the ID of a button, its text, its target, etc.
To do it, go to Tags, add a new Custom HTML tag, paste the event tracking code from Screeb as in 1️⃣ and don't forget to fire the main tag before.
Then, in the triggering section, select "Generic Click Trigger" and select Some Clicks.
This is where you can select the variable of your click, like its text or its ID, to decide that it's on a specific click that you want to trigger this event tracking tag.
Save everything, and Submit your changes.
Click on the button you want to track in your app, and now go back to Screeb, in Settings, Visitor Events. You should see your click event listed.
Now that your events are listed in Screeb, you can use them in your User Segmentation strategy.
And repeat if you want to track other actions, like Forms, Actions on videos, Scrolling, etc.