Search through more than a hundred articles on every aspect of User.com

Agata Jędrzejczyk
Written by Agata Jędrzejczyk

How to fire an event based on time via GTM

Start an event after user stays a specific time on your website


What does it do?

In a few steps, you can configure your User.com app to register if an user stayed specific time on your page and measure the time spent on specific pages of your website.. Then you'll have the option of using the module Event Trigger.

Before you start

You need to have GTM implemented properly on your site. Find out how in here.

How to use it

You can create & configure the triggers in your GTM Workspace that is linked with your website.

1. Open your GTM Workspace connected to your website.

2. Go to Triggers and click New. Then click on Trigger configuration.

From the menu on the right, under Others choose Timer.

3. Next, we have a few things to configure:

  • Let’s name our Trigger, for example, “timer_1minute”.
  • Set up the Interval to 60 000 milliseconds (=1 minute) 
  • Set up Limit to 1 (limit as in the maximum number of times to fire the event)
  • Then, enable this trigger on specific conditions specific, for example "Page URL contains Aneta".
  • Click Save.


4. Go to Tags and create New

  • Choose Tag Type: Custom HTML, name it, and input the code below. This script will let User.com register this event each time it occurs - it should look similar to the screenshot below.

  •  At the bottom of the window, open Advanced Settings and choose the User.com implementation tag to fire before this tag. This way you'll make sure you’re firing tags in the right order.
  •  Next, scroll down Tag Configuration, and in the section Triggering, choose previously created trigger “timer_1minute”.

5. Click "Save" to register your new tag and run Preview to test it out first in the GTM main window.

On your website, in GTM preview window, you will see that the Event fired after X amount of time spent on your specific website -all according to settings you created for your Trigger. 

In User.com app, in your test user’s timeline, you will see the event triggered as below:

 

Now, you can simply start the automation based on this Event:

Related articles

Categories: