images

YouTube Integration

In this chapter, you learn about the integration between Google Analytics and YouTube, which is an important platform for video content publishers. This integration allows you to understand how users interact with your YouTube channel using Google Analytics reports.

Although the official integration does not provide data usage information per video, in this chapter you learn a custom way to bring data related to interactions with videos embedded on your website. The solution in the second section of the chapter was contributed by Stéphane Hamel.

Integrating YouTube Into Google Analytics

The integration between Google Analytics and YouTube is very straightforward. Sign in to your YouTube account and visit http://goo.gl/zzmtwh. On that page you will find a box where you can enter your Google Analytics property tracking ID, similar to Figure 6-1.

images

Figure 6-1: Inserting the Google Analytics tracking code into a YouTube channel

As you can see, it is a very simple interface. The only required step is to add the Google Analytics property tracking ID you use to track your website, or a new one especially for YouTube. There are two ways to set up this integration:

  • Using the same property ID: The advantage of this option is to see a summary of all sessions to your properties; however, it is not possible to deduplicate users visiting both the channel and your website.
  • Using a separate property ID: The advantage of this option is its simplicity; no filters or views are required. You will see the reports for the website and YouTube channel on its own Google Analytics property.

Once this step is completed, your Google Analytics account will start gathering information about activity on the YouTube channel.

NOTE It is important to note that this integration provides data only about the channel page; it does not provide information about activity on individual video pages. Read more about individual video interactions at the end of this section. Also learn how to measure interaction in an embedded YouTube player on your website in the contribution written by Stephane Hamel at the end of the chapter.

Next, I go over the settings that should be implemented in case you choose to track your YouTube channel using the same Google Analytics property ID as the one you use for your main site. In this case, I recommend creating YouTube and non-YouTube views in Google Analytics. Create new views with the filters shown in Figures 6-2 and 6-3 (one view for each filter) on your account. To learn more about creating views, visit http://goo.gl/eevIxD; to learn more about creating filters, visit http://goo.gl/T9hjmV.

  • Only YouTube Traffic: This view shows only the behavior of users in the YouTube channel. Use the filter in Figure 6-2 for this view.
  • NO YouTube Traffic: This view shows only the behavior of users to the website. Use the filter in Figure 6-3 for this view.

images

Figure 6-2: Filter to include YouTube traffic

images

Figure 6-3: Filter to exclude YouTube traffic

In addition to the preceding views, be sure to have an overall view that includes all domains. This will help you analyze the aggregate traffic to the website and to the YouTube brand channel.

Integrating Google Analytics with YouTube will allow you to see which videos, and which annotations inside those videos, bring users to the channel page. This can provide insights into which videos are driving users to further interactions with your channel. In order to find this information, visit the All Pages report at http://goo.gl/BKU8LK in the Only YouTube Traffic view. On this report you will find URLs such as the following: /profile?annotation_id=annotation_1691&feature=iv&user=onbehavior&src_vid=cstxyj0tj6g.

As you can see, those views of your profile (or channel) carry parameters that tell you the annotation_id and src_vid (source video). This can be used to analyze annotations success in bringing video watchers into your company channel, exposing him/her to other videos from your brand channel.

If you want a more in-depth analysis of your video interactions as well as your watchers audience, YouTube provides a rich Analytics tool for video creators at http://goo.gl/lFuYlj. The following list explains some of the information you will find in the tool. The metrics can be segmented by individual video or playlist or seen in total; they can also be segmented by country and viewed for any specific date range.

  • Performance
    • Video views
    • Estimated minutes watched
    • Estimated earnings
  • Engagement
    • Likes
    • Dislikes
    • Comments
    • Shares
    • Favorites added
    • Subscribers
    • Average view duration
    • Average percentage viewed
  • Demographics
    • Gender
    • Age
  • Devices
    • Device type
    • Operating system
  • Traffic Sources

YouTube Video Tracking in Google Analytics Using Google Tag Manager

This section was contributed by Stéphane Hamel, a freelance consultant in the field of Digital Analytics. Named Most Influential Contributor by the Digital Analytics Association, he is the creator of the Online Analytics Maturity Model and the Web Analytics Solution Profiler.

This guide will empower you to start measuring user interactions with embedded videos on your website. After you finish this implementation, visit the Top Events report at http://goo.gl/ElbyDK and you will find the following event hierarchy:

  • Event category: video
  • Event actions: play, pause, exit, 0%, 25%, 50%, 75% and 100%
  • Event label: video unique identifier and title

Implementation Details

This example uses the YouTube JavaScript API (http://goo.gl/mgi4WR) to expose user interactions with the video. In order for this to work, each of your YouTube embeds needs to include enable-jsapi=1 in the link of the video—for example (bold code below):

<iframe width="420" height="315"
  src="//www.youtube.com/embed/Rvw0uxuYBCo?enablejsapi=1"
  frameborder="0" allowfullscreen></iframe>

NOTE The Is YouTube Present variable (discussed later in this section) could be modified to automatically add enablejsapi if it's not there, but this will result in a quick flash of the YouTube frame.

In order to implement this solution, you need to use some built-in variables and create a couple of user-defined variables, two tags, and two triggers. If you are not acquainted with those definitions, read through http://goo.gl/c4rP83.

The actual definitions of the elements mentioned in the previous paragraph are lengthy and include long pieces of code, so you will find all of them in a JSON file available for download at http://goo.gl/rjP3ar.

Google Tag Manager allows users to import and merge container settings to your existing container through a simple process using JSON files. In order to implement this solution, visit the link in the previous paragraph and download the file to your computer. Then log in to your Google Tag Manager account and choose the container you would like to use for this solution.

As shown in Figure 6-4, once you choose your account and container, click on Admin and then on Import Container.

Once you start the Container Import process, you will see a screen similar to Figure 6-5. In this page you will be given the option to upload the file you downloaded in the previous step. You will also be able to choose between “Overwrite” and “Merge” with the existing container. In this case it is recommended that you choose “Merge” and then “Rename conflicting tags, triggers, and variables.” This option will be safer, as it avoids losing any previous configurations; you can always revisit your account and delete tags, triggers, and variables if they are not being used.

images

Figure 6-4: Google Tag Manager settings interface

images

Figure 6-5: Importing and merging the container

Click on Continue and you will have the opportunity to preview and confirm your container import. Figure 6-6 shows a screen similar to what you will receive while importing the container provided in this section. Review it and confirm.

images

Figure 6-6: Preview and confirm your container import

Following is a quick description of the elements imported to your container:

  • Tags
    • YouTube Listener contains the custom logic to detect player events exposed through the YouTube JavaScript API. When a valid event is detected, relevant information is pushed into the dataLayer and a custom event is set to youtube.
    • YouTube Events is a standard Universal Analytics event triggered by the custom dataLayer event mentioned above.
  • Triggers
    • YouTube Ready is a trigger initiated when at least one YouTube embedded video is found and the API is ready.
    • YouTube Event is triggered when a relevant activity is detected by the custom YouTube Listener.
  • Variables
    • Is YouTube Present returns true if there is at least one embedded YouTube video on the page.
    • Data Layer Action and Label retrieve the values exposed by the custom listener.

Custom Report to Monitor Video Performance

That's it! Now you can track YouTube-embedded video on your own website thanks to Google Tag Manager and Universal Analytics. If you want to get details about how individual videos are performing, follow these steps:

  1. Visit the Top Events report at http://goo.gl/EIbyDK and click on Video.
  2. Click on Customize on the top of the report.
  3. Under Dimension Drilldowns, remove the Event Category dimension and switch Event Action with Event Label. It should then read Event Label/Event Action.
  4. Modify the filter to read “Event Category Equals Video” so that only videos are shown in this new custom report.

Voilà! You now have detailed performance info about each video embedded on your website.

Summary

In this chapter you learned about the YouTube integration, which is not as tight as the AdWords or AdSense integrations but provides valuable information about channel page behavior and annotation success.

You also learned how to analyze video interactions on embedded players on your website using a custom container that can be imported to your Google Tag Manager account. This solution will provide you with information on interactions such as play and pause, as well as the percentage watched and for which embedded video.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset