top of page
Writer's pictureKelly Alica Liman

Track Duration Goals (Time on Site Events) in Google Analytics 4 (GA4)

If you want to improve the amount of time users spend on your website and increase their engagement, you can set up Duration Goals. Duration Goals are used to measure how many visitors stay on your website for a certain period. For this, you can create an event in Google Tag Manager that is going to track the time that people spend on your website. For example, an event that triggers every time someone stays on a website for 10 minutes or other set amounts of time. This guide will show you how to create events to Track Duration goals (Time on Site Events) in Google Analytics 4 (GA4)!


---


Looking for help or support on Google Analytics 4?



---


In case you prefer watching a video tutorial, here's a tutorial from XYZ Lab's Youtube Channel. Enjoy!




Topics Covered:



Step 1: Ensure your Google Tag Manager is installed on all website pages


You can follow our tutorial on Installing Google Tag Manager on WordPress and Wix websites.



Step 2: Navigate to Google Tag Manager and create a new Trigger




Step 3: Name the Trigger as the duration of time and select "Timer" as the Trigger type


For example, we will create a trigger named "1 Min Time on Site".



Step 4: Input the duration of the timer in the Interval field using milliseconds


The timer is set in milliseconds. For this example, we will input 60,000 milliseconds (= 1 minute).



Step 5: Input "1" in the Limit field


Limit refers to the amount of time the trigger gets fired. By inputting 1, it means the trigger will only be fired once and not continuously.



Step 6: Select and input the following condition for the trigger: "Page URL matches RegEx .*"




Step 7: Save the Trigger


This is how the Trigger Configuration should look like.



Step 8: Create a new Tag, choose the Tag type as "Google Analytics: GA4 Event" and select "GA4" under Configuration



If this is the first time you're setting up a tag, you can select "None - Manually Set ID" and input your Measurement ID which you can find in Google Analytics under Admin > Data Streams. If this is the second time you're setting up events, the system will have a record your Measurement ID so you can select "GA4".





Step 9: Name the Event




Step 10: Attach the Trigger to the Tag




Step 11: Save, Submit, and Publish the Container


This is how the Tag Configuration should look like.





Step 12: Preview to verify the Tag is working


1. Click on Preview in Google Tag Manager




2. Connect your website



Two tabs will automatically open: your website with the debugger connected and Google Tag Assistant.




3. Stay on your website for the duration of your event and navigate back to Tag Assistant to check if the Tag is fired




Step 13: Repeat the steps above with any duration


For example, we will create a Tag and Trigger for 2 minutes and 3 minutes and input the relevant milliseconds.






Save, submit, and publish the changes. Preview the tag once again and wait on the website for the duration of time you set. The relevant Tags should be fired once the time limit is achieved.







Comments


bottom of page