YouTube Impression, Conversion & Event Tracking
This article will cover the following:
- Step-by-step guide for how to track YouTube impressions, conversions and events
Integrating impression, conversion and event tracking into embedded Youtube videos is as easy as following the 2 steps below. (This guide assumes you've setup your Advertiser, Offer, Affiliate and Campaign as well as having Events enabled in your system with the relevant events setup. )
In this scenario, you would
- Fire an impression when the video loads
- Call an Event when the user clicks play
- Finally, fire a conversion pixel once the user has completed watching the video
While this may not mimick your current use case, the mechanics on setting this up should cover any variation of setup (ie calling a single impression pixel once the video has completed).
- Insert the above code into the head of your page. This code contains special functions for impression pixels, conversion pixels and events pixels. Optionally you can remove these blocks of code if you are not tracking all three.
- IMPORTANT: You will need to modify the iframe calls above to call your instance domain (ie change "...demotrk.cakemarketing.com" to "...your.domain.com"
2. Place your Youtube video player code on the page. This code consist of a div (<div id="player"></div>) that can be placed any where you want the video to display on the page. It also includes calls to the Youtube API to configure your video settings. Finally, we have added our pixel calls to this code which are commented within the code. Read on for formatting your pixel calls.
This code will write the player to the page, call an impression pixel when the page is loaded, call an event when the user clicks play and call a conversion pixel when the video is finished. Keep in mind the working example below is setup to track with CAKE's demo instance so some modifications will need to be made to make it work with your instance.
- More information on Google/Youtube's API documentation: https://developers.google.com/youtube/iframe_api_reference
CAKE pixel formatting and setup
Once you've generated your pixel you will need to get the "E" calue to pass through the function (based on code above)
- ckmImpression('E_VALUE_HERE'); (see line 23 above)
- In some cases your impression pixel may look like the image below. If so you'll need to modify the impression call and impression fire to match.
- Once you've generated your pixel you will need to get the "E" calue to pass through the function (based on code above)
1. Once you've setup your Events you will need to generate your pixel and include the offer id and event id with your ckmEvent call
a. ckmEvent('OFFER_ID_HERE','EVENT_ID_HERE'); (see link 28 above)
1. For conversions you simply need to include the offer id in the ckmConversion call
***Here is a working version with alerts being triggered for the impression, event and conversion: http://demotrk.cakemarketing.com/?a=6184&c=1135796&s1= ***