Manage and track on-site marketing links
You can track on-site links through Digital Analytics by using the site promotions or real estate tracking code and associated reports.
The type of link to be tracked dictates which tracking code and report is implemented. Both site promotions and real estate tracking require the addition of attributes to the HTML anchor to be reported. Site promotions and real estate tracking can be applied individually or in combination to the same link.
For example:
<a href="/path/doc.html" manual_cm_sp="fall-_-sale-_-free shipping"
manual_cm_re="page A-_-left navbar-_-mens shirts">
The value set in manual_cm_sp
and manual_cm_re
is automatically applied to the URL collected with the associated link click tag that is generated automatically upon visitor click of the anchor link. HTML anchor with missing or invalid HREF= url
values such as javascript:function
or mailto:address
prevents collection and reporting of site promotion and real estate click or impression data. Manual impression and link click tags can be implemented to collect site promotions or real estate data for links that are not HTML anchors or are missing valid HREF= values
. In all cases, characters that are not allowed in tag parameters such as single or double quotation marks, are removed from the collected site promotions or real estate data. Those characters do not appear in the reported data.
Site promotions
Use the site promotions report to report the performance of a link across multiple pages, such as when you are comparing the performance of the same promotions that are running on multiple pages across the website. Links are instrumented for tracking by adding a new manual_cm_sp=
attribute value to each HTML anchor tag. The manual_cm_sp=
attribute allows you to specify promotion type, promotion, and link-level information. Each of these three values is placed within the manual_cm_sp=
attribute value, delimited by the string -_-
(hyphen underscore hyphen). The collected values are reported in hierarchical format by links within promotion and promotions within the promotion type. For example:
<a href="/path/doc.html" manual_cm_sp="fall-_-sale-_-free shipping">
In this example, the site promotions report hierarchy is promotion type: fall, promotion: sale, and free shipping.
Real estate
Use the Real Estate Analysis report to report the performance of the same link included multiple times in different areas of a single page, such as for A/B testing. Links are instrumented for tracking by adding a new manual_cm_re=
attribute value to each HTML anchor tag. The manual_cm_re=
attribute allows you to specify the version, page area, and link-level information. Each of these three values is placed within the manual_cm_re=
attribute value, delimited by the string -_-
(hyphen underscore hyphen). The collected values are reported in hierarchical format by links within pages, areas within pages, and areas within versions. For example:
<a href="/path/doc.html" manual_cm_re="page A-_-left navbar-_-mens shirts">
In this example, the real estate report hierarchy is version: page A, page Area: left navbar, and Link: men's shirts.
Real estate collection and reporting require prior identification of page ID values that are hosting the instrumented links. Send this request to Digital Analytics Support for configuration. Include your client ID(s) and the individual page ID values to be activated for each client ID in your request. It is also possible to request wild card activation of real estate reporting for all existing and future page IDs. To request wild card activation of all page IDs for real estate reporting, specify the client ID and value @@REAL_ESTATE_ALL_PAGES_ENABLED@@
in your request. Please be aware that wild card activation of all Page IDs for your client ID can result in an automatic collection of a large volume of impression tags. The page ID activation requirement is unique to real estate tracking and is not required for site promotions reporting.
The URL query string
As an alternative to the collection of on-site marketing link data through the definition of custom anchor attributes, you can implement site promotions and real estate reporting by adding cm_sp=
or cm_re=
query string parameter values to the link URL. This is useful in cases where no HREF attribute exists or no HTML anchor tag exists at the time of page load and the manual link click tag must be implemented.
Site promotion and real estate values that are collected by using URL query string parameters must be URL-encoded. For example, spaces are represented by %20
. Here are some URL query string parameter implementation examples:
http://www.client.com/product.asp?cm_sp=fall-_-sale-_-free%20shipping
http://www.client.com/product.asp?cm_re=page%20A-_-left%20navbar-_-mens%20shirts
http://www.client.com/product.asp?cm_sp=fall-_-sale-_-free%20shipping&cm_re=page%20A-_-left%20navbar-_-mens%20shirts
Automatic impression tag server call charges
Real Estate, Site Promotions, and WebSphere® Commerce E-Marketing Spots generate impressions as well as click-throughs. Every 10 impressions captured costs between 1 and 4 server calls. The exact number of server calls charged varies based on the total combinations of unique SP, RE or CM parameter values processed. For example, if 100 links in the homepage contain Site Promotions/Real Estate parameters and this page is viewed 500,000 times, an additional 5 to 20 million server calls are charged for that period.
By default, impression data collection for all On-Site Marketing Tracking types is enabled:
- cm_TrackImpressions="RSCM"
- Code Definitions: R=Real Estate impressions; S=Site Promotion impressions; CM=WebSphere Commerce E-Marketing Spot impressions.
Automatic Impression data collection can be completely or selectively disabled at the page level through the cmSetupOther function:
- Disable all impressions: cmSetupOther({"cm_TrackImpressions":""});
- Enable only Real Estate impressions: cmSetupOther({"cm_TrackImpressions":"R"});
- Enable only Site Promotion impressions: cmSetupOther({"cm_TrackImpressions":"S"});
- Enable only WebSphere Commerce E-Spot Impressions: cmSetupOther({"cm_TrackImpressions":"CM"});
- Other combinations are possible, such as "RS", "RCM", "SCM", etc.
For implementations not using Digital Analytics Hosted libraries (//libs.coremetrics.com/eluminate.js), impressions are controlled by directly setting var cm_TrackImpressions ="" in the page:
- var cm_TrackImpressions ="";
Ignore impression generation on a page
In addition to globally disabling generation of automatic impression tags, you can use the cmCheckIgnoreImpression(...) function to disable impression generation for specific on-site marketing program values on a page. The eluminate.js tag library runs the cmCheckIgnoreImpression function when evaluating links containing on-site marketing tracking parameters. If the function returns false
, no impression tag is generated. If the function returns true
, the impression tag is generated normally. A return value of true
is the default. This feature is available for the following on-site marketing programs: Site Promotions (sp), Real Estate (re), and E-Marketing Spots for WebSphere Commerce (cr).
Following is an example of blocking the generation of impressions for specific "sp" programs with value a containing -_-C
or globalnav
.
function cmCheckIgnoreImpression(sp){
if(typeof sp != 'undefined'){
if ((sp.indexOf("-_-C") > -1) || (sp.indexOf("globalnav"))> -1) {
return false;
}
} return true;
}
Following is the related HTML example:
<a href="www.nowhere123.com/page1.html?cm_sp=globalnav-_-2-_-3">globalnav-_-2-_-3 link</a>
<a href="www.nowhere123.com/page2.html?cm_sp=2-_-A-_-B">2-_-A-_-B link</a>
<a href="www.nowhere123.com/page3.html?cm_sp=2-_-A-_-C">2-_-A-_-C link</a>
--- cmCheckIgnoreImpressions also supports the manual_cm_sp and manual_cm_re anchor attributes:
<a href="www.nowhere123.com/page1.html" manual_cm_sp="globalnav-_-2-_-3">1-_-2-_-3 link</a>
<a href="www.nowhere123.com/page2.html" manual_cm_sp="2-_-A-_-B">2-_-A-_-B link</a>
<a href="www.nowhere123.com/page3.html" manual_cm_sp="2-_-A-_-C">2-_-A-_-C link</a>
Manual link click and impression tracking
In certain cases, the automatic collection of link clicks and/or impression tags used by Site Promotions and Real Estate reporting cannot function. In these cases, it may be necessary to implement calls to the manual equivalents of the impression and link click tags.
Common scenarios requiring Manual Link Click tags:
- HTML Anchor tags without
HREF=
attributes or otherwise use JavaScript to create navigation at the time of click. - Clicks on Java, Silverlight, or other interactive application elements without HTML anchors.
- HTML Anchor tags in iframes that do not include the Digital Analytics library script blocks and a Page View tag. In these cases, a Link Click is either not collected or is collected without the required Page ID parameter and rejected from reporting.
Manage and track off-site marketing links
External marketing campaigns (such as paid search and promotional email campaigns) are tracked through the Marketing Management Center (cm_mmc=) parameter. You can append this parameter to the query string of the off-site links to be tracked so Digital Analytics automatically attributes session activity to the related marketing programs.
The cm_mmc= parameter must be found in the destination URL of the first Digital Analytics Page View-type tag (pc="Y"
) collected in the visitor session, in order for the session activity to be attributed to the campaign defined in the parameter. This Page View tag must be the first tag received in the visitor session. No special JavaScript tagging is required on the page; however, the Digital Analytics libraries and a Page View-equivalent tag must be present on the marketing landing page.
Implement MMC
Use the cm_mmc= parameter to specify Vendor, Category, Placement, and Item level information. This "VCPI" information is reported in hierarchical format by Items within Placement, Placements within Category, and Categories within each Vendor.
Each of the four values is placed within the cm_mmc= parameter, delimited by the string "-_-
" (hyphen underscore hyphen). Spaces between words are represented by "%20
". For example, http://www.client.com/product.asp?cm_mmc=google-_-general-_-swimwear-_-men's%20swimwear
Marketing Program report hierarchy example:
- Vendor: google
- Category: general
- Placement: swimwear
- Item: men's swimwear
Manual MMC
In addition to using the cm_mmc= parameter, marketing programs can also be tracked by setting the manual MMC page variable on a marketing landing page prior to calling the Page View tag function for that page: var
manual_cm_mmc="vendor-_-category-_-placement-_-item";
The value set in manual_cm_mmc= is automatically applied to the URL collected with the Page View tag from the marketing landing page. This provides a convenient mechanism for implementing code to translate existing marketing link query string parameters into equivalent or similar Digital Analytics cm_mmc= tracking codes.
For IMAP partners
Tracked offsite marketing links can be generated automatically if your marketing partner participates in the Digital Analytics IMAP program. IMAP partners can embed marketing programs deployed through their systems with Digital Analytics cm_mmc= parameters to enable automatic tracking and measurement in the Digital Analytics Marketing Management Center.
Contact your marketing partner or Digital Analytics Support to determine if your partner is an IMAP vendor.
Manage canceled or aborted link and form responses
When sending tags from certain web browsers through onclick=
or onsubmit=
handlers, or equivalent custom events, you might encounter canceled or aborted responses in the browser request log for the generated GET Image requests. These responses occur if the anchor or form target loads a new web document.
For links or forms that load a new page, affected browsers fail to send queued image requests that are created through event JavaScript before running navigation. These requests never reach Acoustic servers and so are not collected or reported. Any browser using the WebKit, Blink, or Gecko engine might be affected, including the following browsers (all versions and OS after 2010):
- Chrome
- Safari
- Firefox
This issue does not affect any version of Microsoft Internet Explorer (Trident engine).
For anchor click and form submit events that generate a Link click tag and Form Action tags, a solution is available through the current Digital Analytics JavaScript tag library (//libs.coremetrics.com/eluminate.js). Enabling the alternative event handlers requires adding a script block to web pages, before the eluminate.js script block. Since the new event handlers can cause issues with certain anchors and forms, this instrumentation is not enabled by default for all Digital Analytics clients. The new anchor and form instrumentation must be enabled by individual Acoustic clients and tested for each site, page, anchor, and form.
Enable an alternative link instrumentation
You can enable alternate link instrumentation to support Gecko, Blink, and WebKit engine browsers (Firefox, Chrome, Safari) that use the cm_NewLinkTracker
function.
Add the following statement as a new script block to the HTML above the existing eluminate.js src= script block:
<script type="text/javascript">cm_NewLinkTracker = true;</script>
<script type="text/javascript" src="//libs.coremetrics.com/eluminate.js"></script>
Note: You cannot use the cmSetupOther
function to enable the alternate link instrumentation.
However, there is a known issue with jQuery or any framework that attaches dynamic events to prevent page navigation when a user clicks a hyperlink. You cannot address issue in the Acoustic tag library or the cm_NewLinkTracker code. Acoustic added support to force individual anchors to use the old link tracker mechanism by specifying a class name value of cmUseOldLinkTracker
in the affected jQuery anchors.
Following is an example of forcing old link tracker code for a specific HREF (adding cmUseOldLinkTracker as a new class attribute):
<a href="url/?qsp=123" id="linky" class="cmUseOldLinkTracker">
A Link that JQuery attached a dynamic event to</a>
Example of forcing old link tracker code for a specific HREF (adding cmUseOldLinkTracker
to an existing class attribute)):
<a href="./?tab=1#tabs" id="Tab1" class="Tab1 cmUseOldLinkTracker">Hot Deals</a>
Enable an alternative form instrumentation
You can enable alternative form instrumentation that supports Gecko, Blink, and WebKit engine browsers (Firefox, Chrome, Safari) with the cm_NewFormTracker
function.
To use the new cm_newFormTracker function, the following requirements must be met:
- Always precede
cm_NewFormTracker{}
definition withcm_NewLinkTracker = true
declaration to ensure that the Acoustic tag library can handle forms that are submitted by calling theform.submit()
method. - Before you enable the
cm_newFormTracker
function, verify that ALL forms on the target pages haveid=
attribute values. - If any form
onsubmit
functions takethis
orevent
as an argument then they must be listed byid= value
within thesubmitFunctions
object in thecm_NewFormTracker
JSON object. Forms without anid= value
, or that takethis
orevent
as an argument in theonsubmit=
handler function and are not listed in thecm_NewFormTracker
JSON object, can generate errors and no longer function correctly.
Example 1: Form HTML
<form id="frm1" action="http://www.google.com" onsubmit="return validate1(this)">
<form id="frm2" action="http://www.google.com" onsubmit="return validate2(event)">
To enable alternative form tracking on a page that includes forms, the structure of the object is:
cm_NewFormTracker={submitFunctions:{"frm1":"validate1","frm2":"validate2"}};
Example 2: Enabling cm_NewFormTracker with no special handling for this
or that
function arguments in onsubmit=
handlers.
<script type="text/javascript">cm_NewLinkTracker = true;cm_NewFormTracker =
{submitFunctions:{}};</script>
<script type="text/javascript" src="//libs.coremetrics.com/eluminate.js"></script>
Example 3: Enabling cm_NewFormTracker + special handling for two forms on the page.
<script type="text/javascript">cm_NewLinkTracker = true;cm_NewFormTracker =
{submitFunctions:{"frm1":"validate1","frm2":"validate2"}};</script>
<script type="text/javascript" src="//libs.coremetrics.com/eluminate.js"></script>
Related HTML forms and JavaScript functions supporting Example 3:
<script type="text/javascript">
function validate1() {alert('validate1'); return};
function validate2() {alert('validate2'); return};
</script>
<form id="frm1" action="http://www.nowhere123.com" onsubmit="return validate1(this)">
<input type="submit" value="frm1 Submit"></form>
<form id="frm2" action="http://www.nowhere123.com" onsubmit="return validate2(event)">
<input type="submit" value="frm2 Submit"></form>
Manage tags generated using native onclick or onsubmit handlers
For tags generated using native onclick= or onsubmit= handlers, or equivalent custom events, in HTML anchor or form elements (example: onclick="cmCreateElementTag(...)";
), enclose the cmCreate function call in a function that adds a setTimeout
delay. This delays execution of navigation and allow time for any queued GET Image requests to actually be sent from the affected browsers.
Function example:
function doCmCall (that) { cmCreateElementTag("elementID", "elementCategoryID");
setTimeout('document.location = "' + that.href + '"', 200) }
HTML example:
<a href="http://site.com/path/somefile.html?action=123"
onclick="doCmCall(this);return false">link</a>
Note: The return false;
value is required or no delay will occur and the generated request will continue to received (Aborted) or (Canceled) response.
Comments
0 comments
Article is closed for comments.