How to Run Gadget Ads on YouTube
Google Gadget Ads can be delivered on YouTube by two different methods:
- Using AdWords
- Using DoubleClick
There are a few differences in how you create your Google Gadget Ad depending on which system delivers it. This document outlines the basic differences in the gadget ad code for each of the two delivery systems. Next, it provides specific directions for creating gadget ads that will be delivered by DoubleClick and run on YouTube.
Contents
- Differences between AdWords and DoubleClick Delivery
- Tracking Clickthroughs Using DoubleClick Delivery
- DART Tag Generator
-
Tracking with Google Analytics
Differences between AdWords and DoubleClick Delivery
In general, the process for creating Google Gadget Ads is the same, whether the ad is delivered using AdWords or DoubleClick. Here are the main differences:
| |
Gadget Ads Delivered with DoubleClick |
Gadget Ads Delivered with AdWords |
| Tracking clickthroughs only |
Use the _ADS_ClickDestinationUrl() method. In addition, you'll need to create some extra HTML code using the DART (Doubleclick Advertising and Reporting Tool) tag generator, as described in the section DART Tag Generator.
|
Use the_ADS_ClickDestinationUrl() method. |
| Tracking interactions |
Use Google Analytics. For more information, see the section in this document on Tracking with Google Analytics . |
Use the _ADS_ReportInteraction() method. |
| Tracking interactions & clickthroughs |
To track both clickthroughs and interactions, use Google Analytics. (For instances where you'll want to execute a clickthrough and also report an interaction that occurs before the page redirects to the destination URL, you need to use the Google Analytics reportPageviewClick() method to ensure successful transmission of the interaction event as well as the redirection. See the section in this document on Tracking with Google Analytics.) |
Use the _ADS_ReportInteractionClick() method. |
| Cookies |
Can use cookies. |
Cannot use cookies. |
| Validation |
Gadget Ads Editor not currently supported. |
Must pass all validation checks run by the Gadget Ads Editor. |
| Size of ad |
- 300 x 250 pixels (medium rectangle)
- 160 x 600 pixels (wide skyscraper)
|
- 300 x 250 pixels (medium rectangle)
- 160 x 600 pixels (wide skyscraper)
|
Tracking Clickthroughs Using DoubleClick Delivery
To track clickthroughs for gadget ads delivered using DoubleClick, use the _ADS_ ClickDestinationUrl() method. This section provides general information on how to use the _ADS_ClickDestinationUrl() method. For full details on this method, see the Gadget Ads Tutorial. This method uses the "clickurl" UserPref, which should be set as follows:
<UserPref name="clickurl" datatype="hidden" default_value="DEBUG"/>
As described in the Tutorial, setting default_value to "DEBUG" creates a confirmation pop-up with a message that indicates when a clickthrough is received. The destination URL is displayed in the confirmation box so that you can check the final destination. Be sure to use Debug mode to verify that all clickthroughs are registering properly. (Debug mode is automatically disabled when the gadget ad goes live on the content network. You do not need to clear the "DEBUG" value before submitting your ad.)
NOTE: To track both clickthroughs and interactions, use the reportPageviewClick() method, described in the section Tracking with Google Analytics.
DART Tag Generator
The DART tag generator is a simple HTML form that allows you to specify the basic URL for your gadget, its size in pixels, and whether to open clickthroughs in a new window. It then generates the HTML snippet that DART will use to serve your gadget ad and creates a preview of your ad.
If you're curious about this snippet, read the Tag Syntax section, which explains the parameters used in this snippet. You won't need to edit this snippet, so you can simply follow the directions in DART Tag Generator, and then cut and paste the generated text into a file used by DART. This file contains the <iframe> that loads your gadget ad.
STEP 1: Fill in the DART Tag Generator form and press Preview This Gadget
STEP 2: Preview Your Gadget.
STEP 3: Save the tag and upload to DART.
B. Copy and paste the tag from the box below into the file and save.
C. In DART, upload the file as the tag.
For debugging, here's the text of the ad (already selected for cut/paste):
Experiment with the DART Tag Generator
After you've created a sample gadget ad, try inserting its URL into the DART tag generator above, check the preview of your ad, and examine the new <iframe> tag created for it.
Tag Syntax
The "src" attribute of the <iframe> element contains the URL for the gadget ad as well as all necessary parameters to render the gadget. This data is automatically generated for you by the DART tag generator and should not be modified. The following table describes the parameters and is intended for information only.
| Parameter |
Expected Value |
Description |
url |
gadget_url |
Absolute URL that points to the location of the gadget ad XML specification. |
synd |
dart |
Syndication mode used to render the gadget ad. This value indicates that the gadget ad is being served on DART. |
up_ads_clicktarget_new_ |
0 or 1 |
Controls whether clickthroughs (calls to _ADS_ClickDestinationUrl()) are opened in a new window. 0=clickthrough uses the current window. 1=clickthrough opens a new window. |
up_aiturl |
(blank) |
(Used by the Interaction Tracking library. Since DART does not use Google's Interaction Tracking library, this value is left blank.) |
up_clickurl |
%c |
This value is a DART macro that will be replaced by the DART tracking URL when the ad is served. This value is used by the _ADS_ClickDestinationUrl() method, which is responsible for tracking clickthroughs. |
Tracking with Google Analytics
This section describes how to use Google Analytics to track (1) interactions only or (2) interactions and clickthroughs for gadget ads delivered using DoubleClick. The Google Analytics library provides two methods for tracking:
| Method |
Description |
Syntax |
ga.reportPageview() |
Tracks pageviews (impressions) and interactions |
reportPageview(path) |
ga.reportPageviewClick() |
Tracks interactions and clickthroughs (ensures that the interaction is successfully reported before the page redirects to the destination URL) |
reportPageviewClick(url, path) |
The reportPageview() method tracks interactions as virtual pageviews (impressions). This method requires a string in order to correctly populate the Analytics content reports. Each call to reportPageview() is recorded as a page request for the string that you provide as a parameter to the method. You can take advantage of this behavior to pass in a fabricated URL path so you can view reports for gadgets in the Google Analytics interface just as you would view reports for website pages.
The reportPageviewClick() method tracks interactions and clickthroughs. It has two parameters: the URL of the clickthrough, and a path that represents a virtual pageview.
Required Steps to Set Up Tracking
To set up tracking with Google Analytics, complete these steps:
- Sign up for a Google Analytics account if you don't already have one. (If you're new to Google Analytics, see "Gadget Tracking" for more information on setting up a Google Analytics account.)
- Obtain a unique domain ID from Google Analytics (see "Gadget Tracking" documentation).
- Include the following line in <ModulePrefs>:
<Require feature="com.google.gadgets.analytics" />
- Initialize the tracking object. Insert your unique doman ID here. Be sure to use the full domain ID, including the ending single numeral.
var ga = new _IG_GA("UA-00000-1");
Using the Tracking Methods
This section provides explains how to use the reportPageview() and reportPageviewClick methods.
Tracking Interactions
The reportPageview(virtual_path) method has one parameter, a string that is the virtual path that represents the pageview or interaction. Here are examples of using the reportPageview() method to track pageviews, interactions, and clicks:
ga.reportPageview('/view/HP Gadget Ad');
ga.reportPageview('/interaction/HP Gadget Ad/play/preview trailer/1.5');
ga.reportPageview('/click/HP Gadget Ad/http://myserver.com/myDetailedInfoPage');
Constructing the Virtual Pageview Path
This section describes a suggested technique for collecting this data in a manner that separates pageviews (impressions), clicks, and interactions, and that tracks multiple types of interactions (events). You are free to develop your own techniques if this one doesn't fit the type of data you're collecting.
Set up your virtual URL to classify first by broad type of action, then gadget name, followed by an optional label and optional numerical value, as follows:
ga.reportPageview('/action_type/gadget_name/opt_label/opt_value');
where
| Parameter |
Description |
action_type |
Classifies the type of user action, such as view, click, or interaction. |
gadget_name |
Is the gadget ad name, such as "HP Gadget Ad." |
opt_label |
Is additional, optional detail about the pageview or interaction being reported:
- If action_type=view, the opt_label is blank or NULL.
- If action_type=click, the opt_label is the URL.
- If action_type=interaction, the opt_label is the interaction name--for example,
play, stop, pause, tab_1, item_1, and so on.
|
opt_value |
Is an optional numeric value greater than 0 to attach to the event. This specification is valid only for interaction types. |
Note that it's important to create a separate tracking URL with action_type=view so that pageviews will not become intermingled with interactions in the Google Analytics reports.
Here is an example of using the reportPageview() method to track pageviews, clicks, and interactions for a hypothetical gadget ad:
ga.reportPageview('/view/HP Gadget Ad');
ga.reportPageview('/interaction/HP Gadget Ad/play/preview trailer/1.5');
ga.reportPageview('/click/HP Gadget Ad/http://myserver.com/myDetailedInfoPage');
Tracking Both Interactions & Clickthroughs
The reportPageviewClick(url, path) method has two parameters: the URL of the clickthrough destination, and a path for recording virtual pageviews, as in the reportPageview() method. For example:
var destUrl = 'http://www.google.com';
var ga = new _IG_GA('UA-000-1');
ga.reportPageviewClick(destUrl, '/action_type/gadget_name/opt_label/opt_value');
Here is an example of a sample gadget that contains calls to report pageviews, interactions, and interactions+clicks using Google Analytics methods:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="My Gadget Ad" width="" height="" thumbnail="" scrolling="false">
<Require feature="ads"/>
<Require feature="com.google.gadgets.analytics"/>
</ModulePrefs>
<UserPref name="clickurl" datatype="hidden" default_value="DEBUG"/>
<UserPref name="aiturl" datatype="hidden" default_value="DEBUG"/>
<UserPref name="ads_clicktarget_new_" datatype="hidden" default_value="1"/>
<Content type="html"><![CDATA[
<a href="javascript:ga.reportPageview('/view/Test Gadget');">Report Pageview</a>
<br>
<a href="javascript:ga.reportPageview('/interaction/Test Gadget/item_1/1.5');">Report Interaction</a>
<br>
<a href="javascript:ga.reportPageviewClick('http://www.google.com', '/click/Test Gadget/http://www.google.com');">Report Interaction & Click</a>
<script>
var ga = new _IG_GA('UA-000000-1');
</script>
]]>
</Content>
</Module>