Engagement/Analytics/Webtrends/Tracking: Difference between revisions
Line 56: | Line 56: | ||
<code>WebTrends.prototype.dcsET=function(){<br> var e=(navigator.appVersion.indexOf("MSIE")!=-1)?"click":"mousedown";<br> this.dcsBind(e,this.dcsDownload);<br> this.dcsBind("contextmenu",this.dcsRightClick);<br> this.dcsBind(e,<font color=red><b>this.dcsLinkTrack</b></font>);<br>}</code> | <code>WebTrends.prototype.dcsET=function(){<br> var e=(navigator.appVersion.indexOf("MSIE")!=-1)?"click":"mousedown";<br> this.dcsBind(e,this.dcsDownload);<br> this.dcsBind("contextmenu",this.dcsRightClick);<br> this.dcsBind(e,<font color=red><b>this.dcsLinkTrack</b></font>);<br>}</code> | ||
3. Verify that automatic link tracking is turned in the inline script: | 3. Verify that automatic link tracking is turned in the inline script on your page: | ||
<code><script type="text/javascript" src="http://mozcom-cdn.mozilla.net/includes/min/min.js?g=js_stats"></script><br><script type="text/javascript"><br>//<![CDATA[<br>var _tag=new WebTrends({"dcsid":"dcst2y3n900000gohmphe66rf_3o6x","rate":5,"fpcdom":"mozilla.org"});<br>_tag.dcsGetId();<br>//]]><br></script><br><script><br>//<![CDATA[<br><font color=red><b>_tag.trackevents=true</b></font>;<br>_tag.dcsCollect();<br>//]]><br></script></code> | <code><script type="text/javascript" src="http://mozcom-cdn.mozilla.net/includes/min/min.js?g=js_stats"></script><br><script type="text/javascript"><br>//<![CDATA[<br>var _tag=new WebTrends({"dcsid":"dcst2y3n900000gohmphe66rf_3o6x","rate":5,"fpcdom":"mozilla.org"});<br>_tag.dcsGetId();<br>//]]><br></script><br><script><br>//<![CDATA[<br><font color=red><b>_tag.trackevents=true</b></font>;<br>_tag.dcsCollect();<br>//]]><br></script></code> |
Revision as of 21:37, 30 December 2011
Custom Conversion Events: DCS Tracking Code
This page is meant to explain how to implement and measure custom conversion events when launching your marketing campaign.
There are a couple of different tagging options depending on what type of reporting you wish to do. I will present each here:
1. Basic 2-step Scenario Analysis reporting usually tracks the presentation of an action (a.k.a an impression) and the actualization of that action, usually a click.
For example, a user may land on a page on the Mozilla.org site that presents them with the option to download Firefox -an impression. The user may then decide to download Firefox by clicking on a link that downloads the application.
So step 1, impression, step 2 click on the download button.
In order to capture this behavior within Webtrends you would apply the following tags as specified below:
In the page header please apply the following META tags (it is these tags that specify the above-mentioned 'impression'):
<META name="WT.si_n" content="Download Firefox" />
<META name="WT.si_x" content="1" />
In order to capture the click event, please apply the following dcsMultiTrack call to the onClick event handler of the associated link:
dcsMultiTrack('DCS.dcssip', 'www.mozilla.org',
'DCS.dcsuri', '/en-US/download',
'WT.ti', 'Link: Download Firefox',
'WT.dl', 1,
'WT.si_n', 'Download Firefox',
'WT.si_x', '2')
Please note the structure of the dcsMultiTrack function call:
dcsMultiTtrack('Name1', 'Value1', 'Name2', 'Value2', ... , 'NameN', 'ValueN')
Here is a short description of the above parameters:
- DCS.dcssip - the domain of the page you wish to track
- DCS.dcsuri - the uri of the page you wish to track
- WT.ti - the link title
- WT.dl - a parameter that specifies a given action - for dcsMultiTrack clicks we use 1
- WT.si_n - the name of the associated 'scenario' you are tracking
- WT.si_x - the step of the associated 'scenario' you are tracking -note for the impression this value is equal to 1 and for the click (or other conversion point) it is equal to 2
CRITICAL: When creating a scenario analysis please consider that it represents a unique set of steps that ultimately result in a conversion. For example, there are several unique pathways a user can follow to download Firefox. Each of these should be considered a separate scenario analysis and tagged accordingly. Re-using scenario analysis names (WT.si_n) across multiple scenario analyses will result in incorrect data and inaccurate reports.
In cases where the conversion action is not unique (e.g. downloading Firefox) it is still necessary to uniquely identify each pathway to our system. This can be accomplished by assigning multiple values to both WT.si_n and WT.si_x using a semi-colon delimiter. For example, on the Firefox download 'Thank You' page (the loading of this page is considered the conversion point) you can set the following META tags:
<META name='WT.si_n', content='download_firefox_A; download_firefox_B'>
<META name='WT.si_x', content='2;2'>
NOTE: The number of semi-colon delimited values for both WT.si_n and WT.si_x must always match.
2. Another type of reporting that requires the use of dcsMultiTrack is campaign tracking. Campaign tracking is also usually a 2-step process. Typically, a banner ad exists on an external site that 'lands' on Mozilla.org. This banner ad is identified by a custom Webtrends parameter called WT.mc_id; it is included as a query parameter on the banner link. The landing page usually presents an action like downloading Firefox. The goal is to determine the effectiveness of a campaign by identifying how many downloads originated from users that clicked the banner ad -or in other words, how many downloads can be 'attributed' to the campaign effort.
In order to capture the download click event we apply the following dcsMultiTrack call to the onClick event handler of the associated link:
dcsMultiTrack('DCS.dcssip', 'www.mozilla.org',
'DCS.dcsuri', '/en-US/download',
'WT.ti', 'Link: Download Firefox',
'WT.z_convert', 'download_firefox',
'WT.dl', 1)
Notice that this may seem redundant because we already implemented a dcsMultiTrack call to track the download click associated with the Scenario Analysis tracking. In fact, it is both redundant and incorrect to make two dcsMultiTrack calls to track the same behavior. So in this case, we can combine the dcsMultiTrack call into one:
dcsMultiTrack('DCS.dcssip', 'www.mozilla.org',
'DCS.dcsuri', '/en-US/download',
'WT.ti', 'Link: Download Firefox',
'WT.z_convert', 'download_firefox',
'WT.dl', 1,
'WT.si_n', 'Download Firefox',
'WT.si_x', '2')
This last call will provide Webtrends with enough data to create both a Scenario Analysis report AND a Campaign Tracking report. Once this data is captured within the Webtrends logfile, custom reports can be created in the OnDemand environment.
Video Tracking: How to Tag It
Setting up your page to track video plays is pretty straight-forward:
1. Include the following JavaScript file: http://www.mozilla.org/js/mozilla-video-tools.js in your page header.
2. Verify that the Webtrends JavaScript file you're using supports automatic link tracking. It should contain a code snippet similar to the following:
WebTrends.prototype.dcsET=function(){
var e=(navigator.appVersion.indexOf("MSIE")!=-1)?"click":"mousedown";
this.dcsBind(e,this.dcsDownload);
this.dcsBind("contextmenu",this.dcsRightClick);
this.dcsBind(e,this.dcsLinkTrack);
}
3. Verify that automatic link tracking is turned in the inline script on your page:
<script type="text/javascript" src="http://mozcom-cdn.mozilla.net/includes/min/min.js?g=js_stats"></script>
<script type="text/javascript">
//<![CDATA[
var _tag=new WebTrends({"dcsid":"dcst2y3n900000gohmphe66rf_3o6x","rate":5,"fpcdom":"mozilla.org"});
_tag.dcsGetId();
//]]>
</script>
<script>
//<![CDATA[
_tag.trackevents=true;
_tag.dcsCollect();
//]]>
</script>
4. Add the following mark-up to reference the video:
<div id="video-player" class="mozilla-video-control">
<video
id="video"
width="640"
height="360"
controls="controls" preload="metadata"
poster="/img/covehead/video/poster-brand.jpg"
src="http://videos-cdn.mozilla.net/your_video.webm">
</video>
</div>
Notice that the id of the div tag is set to video-player. This is required so the reporting engine can differentiate a video play from other type of events that may occur on your page. It must always be set to video-player. Also, the id value in the video tag should designate the name of your video. This will allow Webtrends to distinguish it from other videos on your site.
DCS Tracking: How to Create a Report
The first type of report we are going to cover is a Scenario Analysis report. These reports are typically used to track a predefined set of behaviors. For example, we may be interested in how many users visit the Firefox download page and then go on to download Firefox.
The Scenario Analysis report contains a funnel view and tabular view, please take a look below:
In order to configure the Scenario Analysis reports, please navigate to the following Scenario Analysis report wizard:
Please fill-out the relevant fields, most are self explanatory.
The SmartSource Identification String should match the WT.si_n
parameter specified in the tag.
Go ahead and configure the specific scenario steps by clicking the 'add' button.
Here you can specify the specific step name as it will appear in the report.
After scenario steps have been added they should appear in the 'Ordered List of Steps' widget. At this point a basic Scenario Analysis report is complete. The next step is to add it to a profile.
After the Scenario Analysis report has been added to the profile our analysis servers need to cycle before the report is available.
The second type of report we are going to cover is a basic conversion report:
They're are three parts to this report. It breaks down into a graph, tree and table:
After your site has been tagged with the appropriate Webtrends parameters (as mentioned in a previous Wiki entry) you can configure this report.
There are a couple of ways to go about this. I'll cover the long way first (I recommend following this path until you're comfortable with this type of report configuration):
Go into the administration interface and create a new custom report:
The wizard presents four main steps:
In the general tab, you'll enter basic information.
- Name - specifies how the report will appear in the administration interface.
- Title - the title of the report within the OnDemand UI.
- Category - a way to functionally group various configuration items (e.g. profile, reports, dimensions, measures, filters, etc...). You can add a new category by clicking the highlighted 'Categories' link.
- Short Description - a short summary of the dimensions and measures.
- Help Card Description - a detailed explanation of the schema and purpose of the custom report.
The dimensions tab allow you to choose either a standard or custom dimension to track. In this case, you will be using the Most Recent Campaign (Drilldown):
The measures tab allows you to select a set of measures to attribute to each dimension:
- Visits (Visits) - the count of visits associated with a given Campaign Id.
- Average Visit Duration (Minutes) (Visit Duration (min)) - self explanatory.
- Firefox Downloads - this measure is based upon the custom parameter WT.z_convert that we specified in the tag.
- Conversion % - a calculated measure Firefox Downloads/Visits * 100
The final custom report configuration we're going to cover is the report filter. The report filter allows you specify a subset of data to include in a custom report. This filter can use several criteria (e.g. campaign Id) to specify the data set you're interested in. In this case we have no need for a report filter because we are interested in all campaigns associated with downloading Firefox.
The typical and easier way to create a custom report is to create a copy of a similar report and make the appropriate edits.
In any event, once the report is created add it to the relevant profiles and let them analyze.
Debugging: Why Isn't My Custom Report Populating???
If your report isn't populating please verify the following:
- The relevant pages are tagged with the Webtrends data collection JavaScript.
- The Webtrends tag is firing correctly - a good tool for this is httpfox.
- The dcsid set in the tag is included as a datasource in the profile that contains the custom report.
- The profile's filters are configured to capture the appropriate pages.
Note: If no profile filter is specified, then the profile will include all data associated with the datasources attached to the profile. - The custom report filters are configured to capture the appropriate pages.
Note: If no report filter is specified, then the report will include all records specified by the profile level filter.