Skip to main content
All CollectionsIntegrations
How to Pass Vidalytics Video Watch Data to Google Analytics and Google Tag Manager
How to Pass Vidalytics Video Watch Data to Google Analytics and Google Tag Manager

Integrating Google Analytics with Vidalytics

Erika Lehmann avatar
Written by Erika Lehmann
Updated over a month ago

Note: Our integrations are not available on the Free plan. To gain access, you will need to upgrade to any of our paid plans.

With the Google Analytics integration, the Vidalytics player can send video watch data to your Google Analytics account. This data helps track video events and create audiences for Google Ads.

Connecting Google Analytics

Step 1: Install the Tracking Code

You need to install the appropriate tracking code on the page where the Vidalytics player is embedded.

For Google Analytics via Google Tag Manager (GTM):

<!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-XXXXXXX');</script> <!-- End Google Tag Manager -->

Replace GTM-XXXXXXX with your container ID.

For Universal Analytics (gtag.js):

<!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-X"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){window.dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-XXXXXXXX-X'); </script>

Replace UA-XXXXXXXX-X with your Google Analytics property ID.

For Google Analytics 4 (GA4):

If you have set up Google Analytics 4 from scratch, follow the same steps as above but replace UA-XXXXXXXX-X with GTM-XXXXXXX in your tracking code.

If you are using Universal Analytics and want to send data to Google Analytics 4, add the following line:

gtag('config', 'GTM-XXXXXXX');

Step 2: Enable Google Analytics Integration in Vidalytics

  1. Go to your Vidalytics account and enable Google Analytics integration.

  2. Select the player events you want to track:

    • Play

    • Pause

    • Pause Percentage

    • Watched Percent (25%, 50%, 75%, 99%)

    • Play Gate Submit

  3. Important: Republish your video(s) after enabling the integration.


Step 3: Configure Google Tag Manager (Optional)

If you are using Google Tag Manager, follow these additional steps:

Create User-Defined Variables

  1. Go to Variables > User-Defined Variables > New.

  2. Set the variable type to Data Layer Variable.

  3. Enter videoTitle as the Data Layer Variable Name.

  4. (For Pause Percentage tracking) Create another variable named value.

Create Triggers for Each Event

  1. Go to Triggers > New.

  2. Choose Custom Event as the trigger type.

  3. Configure it for each player event you want to track.

Create Tags for Google Analytics

  1. Go to Tags > New.

  2. Select Google Analytics: GA4 Event.

  3. Configure it for each event, ensuring Pause Percentage includes an additional value parameter.


Step 4: Test the Integration

Using Google Tag Manager Preview Mode

  1. Click Preview in Google Tag Manager.

  2. Enter your website's URL.

  3. Play the video and check the Data Layer events in the left sidebar.

Register Custom Definitions in Google Analytics 4

  1. Go to Configure > Custom Definitions.

  2. Click Create Custom Dimensions.

  3. Add the following:

    • Dimension Name: Any name you choose.

    • Scope: Event.

    • Event Parameter: Enter the parameter exactly as used in GTM.

  4. Save the dimension.

Note: If you want to also send the video watch data from Google Tag Manager to Universal Analytics, you'll have to create an additional user-defined variable:


Step 5: Check Your Data in Google Analytics

Google Analytics 4

  • Real-time Events: Go to Reports > Realtime.

  • Event Table: Check in Configure > Events.

  • Debug Mode: Go to Configure > DebugView.

Universal Analytics

  • Real-time Events: Check events immediately in the reports.

  • Total Events Report: Updates within 24 hours.

  • Detailed View: Click on the "Video" category for more insights.


Step 6: Track Goals in Universal Analytics

To track goals based on video watch time:

1. Set the goal type as Custom.

2. Add a title and select Event as the goal type.

3. Configure goal details:

  • Category: video

  • Action: Play, Pause, Pause Percentage, or specific watch percentages (e.g., 30% watched).

  • Label: The title of your video.

  • Value: (Only for Pause Percentage tracking, e.g., 35 for 35% pause).

4. Save your goal.

You’re all set! πŸŽ‰ Now your Vidalytics video data is successfully integrated with Google Analytics, enabling you to track engagement and optimize performance. πŸš€


For additional questions, feedback or assistance please feel free to reach out directly to support at [email protected]. 😊

Did this answer your question?