Differentiate links that reference the same Link ID and region
You can differentiate links by customizing the link ID using the s_objectID variable, by customizing the region, and by customizing the AppMeasurement ActivityMap module file .
As an example, let’s say you have multiple “Buy” links that are identified by Activity Map under the same Link ID and Region:
<div id="recommendation panel">
<div>
<a href="product1.html">Buy</a>
</div>
<div>
<a href="product2.html">Buy</a>
</div>
<div>
<a href="product3.html">Buy</a>
</div>
</div>
Buy
Buy
Buy
recommendation panel
recommendation panel
recommendation panel
How can you customize your web page and tagging to differentiate the values of these links? You have three options: You can customize the Link ID, or customize the region, or customize the AppMeasurement ActivityMap Module file.
Customize the Link ID Using s_objectID section_01B0D463397B4837B2D46F087A6E5937
By creating a unique object ID, s_objectID
, for a link or link location on a page, you can either improve Activity Map tracking or use Activity Map to report on a link type or location, rather than the link URL. Click here for more information on the s_objectID
variable.
;
) is required when using s_objectID
in Activity Map.<div id="recommendation panel">
<div>
<a onClick="s_objectID='Product1';" href="product1.html">Buy</a>
</div>
<div>
<a onClick="s_objectID='Product2';" href="product2.html">Buy</a>
</div>
<div>
<a onClick="s_objectID='Product3';" href="product3.html">Buy</a>
</div>
</div>
Product1
Product2
Product3
recommendation panel
recommendation panel
recommendation panel
Customize the Region section_6B1EF302573B445DBAF44176D0A12DB9
You can customize the region by ensuring that each “Buy” link has its own Region defined. To do so, add an "id"
parameter to one of the parents of each “Buy” anchor tag.
"id"
parameter as a region identifier. You can also set your own identifier using the JavaScript variable "s.ActivityMap.regionIDAttribute"
.<div id="recommendation panel">
<div id="region a">
<a href="product1.html">Buy</a>
</div>
<div id="region b">
<a href="product2.html">Buy</a>
</div>
<div id="region c">
<a href="product3.html">Buy</a>
</div>
</div>
Buy
Buy
Buy
region a
region b
region c
Customize the AppMeasurement ActivityMap Module file section_B933BB9F944E4D5389002908A5A881F8
Here are a couple of examples of generic link/region functions you could include (in modified form) in your AppMeasurement.js file.
s.ActivityMap.link = function(ele, linkName) {
if (linkName) {
return linkName;
}
if (ele) {
if (ele.tagName == 'A' && ele.href) {
return ele.href;
}
}
}
The linkName
is passed during calls to s.tl()
.
s.ActivityMap.region = function(ele) {
var className,
classNames = {
'header': 1,
'navbar': 1,
'left-content': 1,
'main-content': 1,
'footer': 1,
};
while ((ele && (ele = ele.parentNode))) {
if ((className=ele.className) && classNames[className]) {
return className;
}
}
return "BODY";
}