Set up your gtag.js to receive Videoly events to your GA4

You can set up the reporting to send events only to your GA4, or to both your Universal GA and GA4.

💡Universal GA will be replaced by GA4 on 1 July 2023. Don't forget to set up your GA4 property to ensure you don't lose historical data.  

How to get started

Step 1: Gtag.js 

  • Check if you have installed gtag.js according to  Google’s default configuration ( which contains a Google Analytics measurement ID, *see snippet below).
  • If your gtag.js setup differs from Google’s default configuration, you can easily amend this by adding a snippet to enable events to your gtag.js with the help of a tag manager, such as Google Tag Manager (GTM).

💡Note: to set up events for both Universal GA and GA4, make sure your gtag.js contains measurement IDs for both instances. 

💡Note: “G-XXXXXXXXXX” is your GA4 ID.

👉 Option 1: Send Videoly events ONLY to GA4:

<script>
 window.dataLayer = window.dataLayer || [];
 function gtag(){dataLayer.push(arguments);}
 gtag('js', new Date());
 gtag('config', 'G-XXXXXXXXXX');
</script>

👉 Option 2: Send Videoly events to BOTH Universal GA and GA4:

<script>
 window.dataLayer = window.dataLayer || [];
 function gtag(){dataLayer.push(arguments);}
 gtag('js', new Date());
 gtag('config', 'G-XXXXXXXXXX');
gtag('config', 'UA-XXXXXXX-X');
</script>

Step 2: Extend your data retention limit

GA4's data retention is automatically set to 2 months. To adjust this, do the following:

  • Go to 'Admin'
  • Click 'Data Settings'
  • Click 'Data Retention' and set to '14 months'

Step 3: Give us a shout

Contact us at support@videoly.co to confirm that your gtag is set up and we'll configure everything on our end.

Step 4: Set up audiences in GA4. Watch our short video guide HERE

Questions? Please reach out to our team via support@videoly.co

Want to know more about the GA events we send you? Read more HERE.

👉 Want to get the most from your video statistics? Our Google Analytics integration is the best way to upgrade your analytics. Just contact support@videoly.co to learn more.

Was this article helpful?