Pop up YouTube Video Tracking using Google Tag Manager

Standard

Recently, one of client asks me to track pop up/Popup a YouTube video with autoplay/without AutoPlay using Google Tag Manager, once I looked his website was built in WordPress and use one of the plugin (Responsive YouTube & Vimeo Video Lightbox Plugin for WordPress) to set up Pop YouTube Video. Once review the code of a website and found It seems you don’t have a query on your site and you are using it in a tag.

Here is Popup YouTube Video Tracking

Pop Up YoutUbe Video Tracking using Google Tag Manager

 

What is Challenge here

Write a custom javascript and custom html to get to work a Pop up youtube video using Google Tag Manager.  To get progres event tracking like Play, Pause, Watch to End, and view 10, 25, 50, 75, and 90% of the video in Google Analytic using Google Tag Manager.

Step 1. Create the YouTube is Present Macro with Pop up Video Tracking using Google Tag Manager 

Macro Name: YouTube is Present for Popup Video Tracking using Google Tag Manager
Macro Type: Custom Javascript
Custom Javascript: See below in Screen

Tracking Pop up YouTube Video Tracking

Tracking Pop up Video Tracking Presence using Google Tag Manager

Step 2. Track Pop up  Video Tracking using Google Tag Manager 

Tag Name: YouTube Listener to Pop up Video Tracking using Google Tag Manager
Tag Type: Custom HTML Tag

Popup Youtube Video Tracking

Step 3. Written again a custom html to fire on Popup click with data layer to message when pop video click Track Pop up  Video Tracking using Google Tag Manager 

PopUp Video Tracking

Firing Rules 

Rule Name: YouTube present
Conditions:
{Event name equals gtm.dom
{{YouTube is Present}} equals true

YouTube Video Tracking using Google Tag Manager

Pop up Light box YouTube Video Tracking using Google Tag Manager

Step 3. Create Macros for Event Action, Event Category, and Event Label Pop up Light box YouTube Video Tracking using Google Tag Manager

A: Event Action Macro using Popup YouTube Video Tracking using Google Tag Manager

Macro Name: dataLayer action
Macro Type: Data Layer Variable
Data Layer Variable Name: eventAction
Data Layer Version: Version 2
Default Value: (blank)

Pop up Light box YouTube Video Tracking

Popup YouTube Video Tracking using Google Tag Manager

B: Event Category Macro using Popup YouTube Video Tracking using Google Tag Manager

Macro Name: dataLayer category
Macro Type: Data Layer Variable
Data Layer Variable Name: eventCategory
Data Layer Version: Version 2
Default Value: (blank)

Pop up Light box YouTube Video

Popup YouTube Video Tracking using Google Tag Manager

C: Event Label Macro using Popup YouTube Video Tracking using Google Tag Manager

Macro Name: dataLayer label
Macro Type: Data Layer Variable
Data Layer Variable Name: eventLabel
Data Layer Version: Version 2
Default Value: (blank)

Light box YouTube Video Tracking using Google Tag Manager

Popup YouTube Video Tracking using Google Tag Manager

Step 4. Create UA Youtube Event – UA Tag & Check for YouTube Event Rule Pop up Light box YouTube Video Tracking using Google Tag Manager

Tag Name: UA YouTube Video Tracking – Video Page
Tag Type: Universal Analytics
Tracking ID: (your Google Analytics ID)
Track Type: Event
Event Tracking Parameters:
Category: {{dataLayer category}}
Action: {{dataLayer label}}
Label: {{dataLayer action}}

 YouTube Video Pop Tracking

Tag Setup for Pop up Light box YouTube Video Tracking using Google Tag Manager

Firing Rules

Rule Name: YouTube event

Fire On

Event name equals youtube

Custom Even Tracking for Youbube Video

It’s time show result in Google Analytic for Popup  Youtube Video Tracking 

Popup Youtueb Video Result in Google Analytic

Warning:if you do n’t know about javascript or do n’t have developing knowledge then do n’t try to implement on Popup YouTube Video Tracking using Google Tag Manager that can broke your site, Cart and other functionality 

Disclaimer: Google tag manager belongs to Google property 

For Contact: mappchero@gmail.com

No Fields Found.

HTML5 Video Views & Progress Tracking using Google Tag Manager /Google Analytic

Standard

Recently one client has asked to track HTML5 video performance using Google Analytic/Google Tag Manager

Track HTML5 Video Views and Progress Tracking  using  Google Tag Manager / Google Analytics

You can monitor the performance of HTML5 Video Tracking using Google Analytic/Google Tag Manager, that will help you understand about your users behavior, How users are interacting with your HTML5 Video players. Anybody who has embedded HTML5 video players on their web site knows how precious it may be to figure out whether visitors are really seeing those videos. You may need to monitor whether they quit short or whether individuals are viewing until the ending.

Default Configuration:  you will see default progress metrics in your google Analytic

  • Play
  • Paused 
  • End
  • 25% 
  • 50%
  • 75%
  • 100%

Step 1. Create the isHTML5 Video Present Tracking  is Macro  Tracking using Google Tag Manager/Google Analytic  

function () {
var video = document.getElementsByTagName(“video”).length;
if (video > 0) {
return “true”;
}
}

Tracking HTML5 Videos with GTM

HTML5 Video Tracking for Google Tag Manager

Step 2. Create Custom HMTL Tag for HTML5 Video Tracking using Google Tag Manager 

Tag Name:HTML5 Video Tracking Tags using Google Tag Manager
Tag Type: Custom HTML Tag

Track Click on html5 video

Tracking HTML5 Players with Google Tag Manager

Firing Rules 

Rule Name: Fire HTML5 Video Tracking
Conditions:
{Event name equals gtm.dom
{{isHTML5 Video Present}} equals true

HTML5 Video Measurement with Google Tag Manager

Track HTML5 Video Events using Google Tag Manager

Step 3. Create Macros for Event Action, Event Category, and Event Label HTML5 Video Tracking using Google Tag Manager

Step 4. Create UA HTML5 Video Event – UA Tag & Check for HTML5 Event Tracking using Google Tag Manager

Now Now time show results Html5 Video Tracking result and Verified with Google Analytics 

htm

For Contact: mappchero@gmail.com

Warning:if you do n’t know about javascript or do n’t have developing knowledge then do n’t try to implement onHtml5 Video Tracking using Google Tag Manager  that can broke your site, Cart and other functionality 

Disclaimer: Google tag manager belongs to Google property 

Embadded Tracking Vimeo video in Google Analytics using Tag Manager

Standard

Are you looking to Track Vimeo Videos with Google Tag Manager and Google Analytics (with iframe or without iframes on Vimeo) or Vimeo tracking inside a lightbox 

Get more insights than before into how people are participating with our powerful analytics tools with your Vimeo videos using Google Tag Manager and Google Analytic

To track embedded Vimeo videos in Google Analytics using Google Tag Manager, you can follow these steps:

Go to your Google Tag Manager account and create a new tag for your Vimeo video tracking.

Choose “Custom HTML” as your tag type and paste the Vimeo player code into the HTML box.

Add a listener to the Vimeo player to track the events you want to capture, such as play, pause, and finish.

Set up a trigger to fire the tag when the video starts playing.

Configure your tag to send data to Google Analytics, using the appropriate tracking code and event categories.

Test your tag and preview it in your Tag Manager account to ensure that it is working correctly.

Publish your tag and monitor your Google Analytics reports to track the performance of your Vimeo videos.

Note that Vimeo also offers its own analytics tools that can be used to track video performance, including views, engagement, and retention. These can be accessed by logging into your Vimeo account and going to the “Stats” section for your videos.

The setup of all of these options requires javascript and dependent on regardless if you are using Google Tag Manager you can put script directly into custom HTML in Google Tag Manager

This can provide you with an understanding of the way people have interacted embadded Vimeo  along using Google Tag Mag Manager. like

  • Play events
  • Pause events
  • Watch to End events
  • 10, 25, 50, 75, & 90% Completion events

Step 1. Tracking Vimeo Video views with Google Tag Manager

Tag Name:  Track Vimeo Video Engagement In Google Analytics Using Google tag manager
Tag Type: Custom HTML Tag

Note:  You need to modify below HTML Code according to Embedded Tracking Vimeo Video using  using below custom html Code 

Videmo

Track Vimeo via Google Tag Manager

Tracking Vimeo using Google Tag Manager

Tracking Vimeo using Google Tag Manager

Firing Rules 

Rule Name: All Pages

Embedded Tracking Vimeo Video with Google Tag Manager

Embedded Tracking Vimeo Video with Google Tag Manager

Step 3. Create Macros for Event Action, Event Category, and Event Label Tracking Vimeo Video  with Google Tag Manager

A: Event Action Macro using Tracking Vimeo Video views with Google Tag Manager

Macro Name: dataLayer action
Macro Type: Data Layer Variable
Data Layer Variable Name: eventAction
Data Layer Version: Version 2
Default Value: (blank)

Google Analytics Vimeo Video Tracking

Google Analytics Vimeo Video Tracking

B: Event Category Macro Tracking using Vimeo Video views with Google Tag Manager

Macro Name: dataLayer category
Macro Type: Data Layer Variable
Data Layer Variable Name: eventCategory
Data Layer Version: Version 2
Default Value: (blank)

Event tracking for Vimeo in Google Tag Manager

Event tracking for Vimeo in Google Tag Manager

C: Event Label Macro using Tracking Vimeo Video views with Google Tag Manager

Macro Name: dataLayer label
Macro Type: Data Layer Variable
Data Layer Variable Name: eventLabel
Data Layer Version: Version 2
Default Value: (blank)

GTM and Vimeo Tracking

GTM and Vimeo Tracking

Step 4. Create UA Vimeo Video Event – UA Tag & Check for Vimeo Event Rule  Vimeo Video Tracking using Google Tag Manager

Tag Name: UA Vimeo Video Tracking – Video Page
Tag Type: Universal Analytics
Tracking ID: (your Google Analytics ID)
Track Type: Event
Event Tracking Parameters:
Category: {{dataLayer category}}
Action: {{dataLayer label}}
Label: {{dataLayer action}}

Vimeo Video Tracking

Google Tag Manager Vimeo Video Tracking – Tags

Firing Rules

Rule Name: Viemo event

Fire On

Event name equals vimeo

vimeo

Result Behavior under Event in Google Analytic 

bb

 

Warning:if you do n’t know about javascript or do n’t have developing knowledge then do n’t try to implement on Vimeo Video Tracking using Google Tag Manager that can broke your site, Cart and other functionality 

Disclaimer: Google tag manager belongs to Google property 

I am avaible for Hire on Freelancer: Freelancer.com

I am avaible for Hire on Upwork: Upwork.com

I am avaible for Hire on Peopleperhour: Peopleperhour.com

I am avaible for Hire on Guru: Guru.com

Iframe YouTube Video Tracking with UPVUE PLAYER using Google Tag Manager

Standard

Automatically Track IFrame YouTube videos with UPVUE PLAYER (Captions and transcripts include hearing impaired and second-language viewers) using Google Tag Manager

Iframe YouTube videos event tracking with UPVUE PLAYER (Captions and transcripts include hearing impaired and second-language viewers) using Google Tag Manager.

If you are looking youtube video tracking using Google Tag Manager Like Iframe YouTube Video,  Pop Up youtube video tracking and Track IFrame YouTube videos with UPVUE PLAYER.

Step 1. Create the YouTube is Present Macro with UPVUE PLAYER using Google Tag Manager 

Macro Name: YouTube is Present for UPVUE PLAYER using Google Tag Manager
Macro Type: Custom Javascript
Custom Javascript: See below in Screen

Tracking YouTube Presence using Google Tag Manager

Tracking YouTube Presence using Google Tag Manager

Step 2. Track IFrame YouTube videos with UPVUE PLAYER using Google Tag Manager 

Tag Name: YouTube Listener to IFrame YouTube videos with UPVUE PLAYER Google Tag Manager
Tag Type: Custom HTML Tag

Note:  You need to modify below HTML Code according to Youtube Video using Like Iframe YouTube Video,  Pop Up youtube video tracking and Track IFrame YouTube videos with UPVUE PLAYER.

<script type=”text/javascript”>
for (var e = document.getElementsByTagName(“iframe”), x = e.length; x–;)
if (/youtube.com\/embed/.test(e[x].src))
if(e[x].src.indexOf(‘enablejsapi=’) === -1)
e[x].src += (e[x].src.indexOf(‘?’) ===-1 ? ‘?’:’&’) + ‘enablejsapi=1’;

var gtmYTListeners = [];
function onYouTubeIframeAPIReady() {
for (var e = document.getElementsByTagName(“iframe”), x = e.length; x–;) {
if (/youtube.com\/embed/.test(e[x].src)) {
gtmYTListeners.push(new YT.Player(e[x], {
events: {
onStateChange: onPlayerStateChange,
onError: onPlayerError
}
}));
YT.gtmLastAction = “p”;
}
}
}
function onPlayerStateChange(e) {
e[“data”] == YT.PlayerState.PLAYING && setTimeout(onPlayerPercent, 1000, e[“target”]);
var video_data = e.target[“getVideoData”](),
label = ‘ ‘+video_data.title;
if (e[“data”] == YT.PlayerState.PLAYING && YT.gtmLastAction == “p”) {
dataLayer.push({
event: “youtube”,
action: “play”,
label: label
});
YT.gtmLastAction = “”;
}
if (e[“data”] == YT.PlayerState.PAUSED) {
dataLayer.push({
event: “youtube”,
action: “pause”,
label: label
});
YT.gtmLastAction = “p”;
}
}

function onPlayerError(e) {
dataLayer.push({
event: “error”,
action: “GTM”,
label: “youtube:” + e
})
}

// report the % played if it matches 0%, 25%, 50%, 75% or completed
function onPlayerPercent(e) {
if (e[“getPlayerState”]() == YT.PlayerState.PLAYING) {
var t = e[“getDuration”]() – e[“getCurrentTime”]() <= 1.5 ? 1 : (Math.floor(e[“getCurrentTime”]() / e[“getDuration”]() * 4) / 4).toFixed(2); if (!e[“lastP”] || t > e[“lastP”]) {
var video_data = e[“getVideoData”](),
label = ‘ ‘+video_data.title;
e[“lastP”] = t;
dataLayer.push({
event: “youtube”,
action: t * 100 + “%”,
label: label
})
}
e[“lastP”] != 1 && setTimeout(onPlayerPercent, 1000, e);
}
}

window.onbeforeunload = function (e) {
var e = e || window.event;
// For IE and Firefox prior to version 4
if(e)
e.returnValue = ‘na’;
// For Safari
return ‘na’;
};
window.onbeforeunload = trackYTUnload;

function trackYTUnload() {
for (var i = 0; i < gtmYTplayers.length; i++)
if (gtmYTlisteners[i].getPlayerState() === 1) { // playing
var video_data = gtmYTlisteners[i][‘getVideoData’](),
label = ‘ ‘+video_data.title;
dataLayer.push({
event: ‘youtube’,
action: ‘exit’,
label: label
});
}
}
// load the Youtube JS api and get going
var j = document.createElement(“script”),
f = document.getElementsByTagName(“script”)[0];
j.src = “//www.youtube.com/iframe_api”;
j.async = true;
f.parentNode.insertBefore(j, f);
</script>

Firing Rules 

Rule Name: YouTube present
Conditions:
{Event name equals gtm.dom
{{YouTube is Present}} equals true

2016-06-10_0337d

Step 3. Create Macros for Event Action, Event Category, and Event Label Iframe Youtube Video  with UPVUE PLAYER using Google Tag Manager 

A: Event Action Macro using Iframe Youtube Video with UPVUE PLAYER using Google Tag Manager

Macro Name: dataLayer action
Macro Type: Data Layer Variable
Data Layer Variable Name: eventAction
Data Layer Version: Version 2
Default Value: (blank)

2016-06-12_1535

B: Event Category Macro using Iframe Youtube Video with UPVUE PLAYER using Google Tag Manager

Macro Name: dataLayer category
Macro Type: Data Layer Variable
Data Layer Variable Name: eventCategory
Data Layer Version: Version 2
Default Value: (blank)

Event Category Macro using Iframe Youtube Video with UPVUE PLAYER using Google Tag Manager

Event Category Macro using Iframe Youtube Video with UPVUE PLAYER using Google Tag Manager

C: Event Label Macro Iframe Youtube Video with UPVUE PLAYER using Google Tag Manager

Macro Name: dataLayer label
Macro Type: Data Layer Variable
Data Layer Variable Name: eventLabel
Data Layer Version: Version 2
Default Value: (blank)

 Event Label Macro Iframe Youtube Video with UPVUE PLAYER using Google Tag Manager

Event Label Macro Iframe Youtube Video with UPVUE PLAYER using Google Tag Manager

Step 4. Create UA Youtube Event – UA Tag & Check for YouTube Event Rule Iframe Youtube Video  with UPVUE PLAYER using Google Tag Manager 

Tag Name: UA YouTube Video Tracking – Video Page
Tag Type: Universal Analytics
Tracking ID: (your Google Analytics ID)
Track Type: Event
Event Tracking Parameters:
Category: {{dataLayer category}}
Action: {{dataLayer label}}
Label: {{dataLayer action}}

 YouTube Video Pop Tracking

Tag Setup for YouTube Video Pop Tracking

Firing Rules

Rule Name: YouTube event

Fire On

Event name equals youtube

 

 

Custom Even Tracking for Youbube Video

Custom Even Tracking for Youbube Video

Step 5. Check iframe Youtube with UPVUE PLAYER using Google Tag Manage into Google Analytics Real-Time Report

Real Time YouTube Video Tracking

Real Time YouTube Video Tracking

Warning:if you do n’t know about javascript or do n’t have developing knowledge then do n’t try to implement on iframe Youtube with UPVUE PLAYER using Google Tag Manager that can broke your site, Cart and other functionality 

Disclaimer: Google tag manager belongs to Google property 

For Contact: mappchero@gmail.com

I am avaible for Hire on Freelancer: Freelancer.com

I am avaible for Hire on Upwork: Upwork.com

I am avaible for Hire on Peopleperhour: Peopleperhour.com

I am avaible for Hire on Guru: Guru.com

No Fields Found.

pop up and Lightbox youtube video tracking using Google Tag Manager

Standard

Pop up Light box YouTube Video Tracking via Google Tag Manager (Pop up)

Are you looking how to analyze the reach of different types of interaction with Pop Up out YouTube Video on the web pages.

Pop-up lightboxes can be used to track YouTube video views by embedding the YouTube video within the lightbox and adding tracking code to the video’s URL. This allows you to track metrics such as views, play rate, and engagement directly in your analytics platform. Some popular analytics platforms that support YouTube tracking include Google Analytics, Adobe Analytics, and Mixpanel. Additionally, you can also use third-party tools such as Wistia, Vidyard, or SproutVideo to track and host your YouTube videos.

When you have a site with embedded / Pop up lightbox YouTube Videos tracking you could track how your visitors have interaction with YouTube Video using Google Tag Manager and You can see result in Google Analytic.

To track a pop-up or lightbox YouTube video using Google Analytics, you can use Google Tag Manager to set up tracking events. Here are the general steps:

Create a new tag in Google Tag Manager and choose “YouTube Video” as the tag type.

Enter the YouTube video ID or URL and any other relevant settings, such as autoplay or loop.

Create a trigger for the tag, such as a click on a button or a specific pageview.

Add Google Analytics tracking to the tag by selecting the appropriate Google Analytics property and tracking type.

Test the tag and publish it to your website.

Once the tag is set up and published, you should be able to view YouTube video metrics in your Google Analytics reports, such as video views, play time, and completion rate. You can also set up custom events to track specific user interactions with the video, such as play, pause, and volume changes.

This can provide you with an understanding of the way people have interacted along with your Pop up lightbox /iframe/Any Type of YouTube videos using Google Tag Mag Manager. like

  • Play events
  • Pause events
  • Watch to End events
  • 10, 25, 50, 75, & 90% Completion events

Step 1. Create the YouTube is Present Macro with Pop up Light box YouTube Video Tracking using Google Tag Manager 

Macro Name: YouTube is Present for Pop up Light box YouTube Video Tracking using Google Tag Manager
Macro Type: Custom Javascript
Custom Javascript: See below in Screen

Tracking Pop up Light box YouTube Video Tracking Presence using Google Tag Manager

Tracking Pop up Light box YouTube Video Tracking Presence using Google Tag Manager

Step 2. Track Pop up Light box YouTube Video Tracking using Google Tag Manager 

Tag Name: YouTube Listener to Pop up Light box YouTube Video Tracking using Google Tag Manager
Tag Type: Custom HTML Tag

Note:  You need to modify below HTML Code according to YouTube Video using Jquery for Pop up Light box YouTube Video Tracking  using Google Tag Manager similar like below

<script>
$(function() {
$(“.play”).jqueryVideoLightning({
});
});
</script>

2016-06-12_1511

Firing Rules 

Rule Name: YouTube present
Conditions:
{Event name equals gtm.dom
{{YouTube is Present}} equals true

YouTube Video Tracking using Google Tag Manager

Pop up Light box YouTube Video Tracking using Google Tag Manager

Step 3. Create Macros for Event Action, Event Category, and Event Label Pop up Light box YouTube Video Tracking using Google Tag Manager

A: Event Action Macro using Pop up Light box YouTube Video Tracking using Google Tag Manager

Macro Name: dataLayer action
Macro Type: Data Layer Variable
Data Layer Variable Name: eventAction
Data Layer Version: Version 2
Default Value: (blank)

Pop up Light box YouTube Video Tracking

Pop up Light box YouTube Video Tracking using Google Tag Manager

B: Event Category Macro using Pop up Light box YouTube Video Tracking using Google Tag Manager

Macro Name: dataLayer category
Macro Type: Data Layer Variable
Data Layer Variable Name: eventCategory
Data Layer Version: Version 2
Default Value: (blank)

Pop up Light box YouTube Video

Pop up Light box YouTube Video Tracking using Google Tag Manager

C: Event Label Macro using Pop up Light box YouTube Video Tracking using Google Tag Manager

Macro Name: dataLayer label
Macro Type: Data Layer Variable
Data Layer Variable Name: eventLabel
Data Layer Version: Version 2
Default Value: (blank)

Light box YouTube Video Tracking using Google Tag Manager

Pop up Light box YouTube Video Tracking using Google Tag Manager

Step 4. Create UA Youtube Event – UA Tag & Check for YouTube Event Rule Pop up Light box YouTube Video Tracking using Google Tag Manager

Tag Name: UA YouTube Video Tracking – Video Page
Tag Type: Universal Analytics
Tracking ID: (your Google Analytics ID)
Track Type: Event
Event Tracking Parameters:
Category: {{dataLayer category}}
Action: {{dataLayer label}}
Label: {{dataLayer action}}

 YouTube Video Pop Tracking

Tag Setup for Pop up Light box YouTube Video Tracking using Google Tag Manager

Firing Rules

Rule Name: YouTube event

Fire On

Event name equals youtube

Custom Even Tracking for Youbube Video

Warning:if you do n’t know about javascript or do n’t have developing knowledge then do n’t try to implement on Pop up Light box YouTube Video Tracking using Google Tag Manager that can broke your site, Cart and other functionality 

Disclaimer: Google tag manager belongs to Google property 

For Contact: mappchero@gmail.com

I am avaible for Hire on Freelancer: Freelancer.com

I am avaible for Hire on Upwork: Upwork.com

I am avaible for Hire on Peopleperhour: Peopleperhour.com

I am avaible for Hire on Guru: Guru.com