Skip to content

Commit

Permalink
Explore attributes: registration tag, names
Browse files Browse the repository at this point in the history
Amended explore attributes logic to work also for Registration tags;
Added name of the explore attribute so that it is clear which http
parameter is used.
  • Loading branch information
zlatinz committed Jul 7, 2014
1 parent 62c0e5c commit ab9bbab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions gettags.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ chrome.webRequest.onBeforeSendHeaders.addListener(

// explore attributes for the different coremetrics tags
// get all query parameters matching ..._a99 pattern - pv_a99, pr_a99, s_a99, o_a99, etc.
var exploreAttributesPattern = /_a([\d]+)$/;
var exploreAttributesPattern = /(_a|rg)([\d]+)$/;
var exploreAttributes = Object.keys(queryString).filter( function(element) {return exploreAttributesPattern.test(element)} );
for (index=0; index<exploreAttributes.length; index++) {
attributeName = exploreAttributes[index];
attributeNameIndex = exploreAttributesPattern.exec(attributeName)[1];
attributeNameIndex = exploreAttributesPattern.exec(attributeName)[2];
tabParams[attributeName]=queryString[attributeName] || '';
}

Expand Down
6 changes: 3 additions & 3 deletions tagwindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var tid_hash = { 1: "Page View Tag",

chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
var whichSite = request.destinationUrl.split('/')[2];
var exploreAttributesPattern = /_a([\d]+)$/;
var exploreAttributesPattern = /(_a|rg)([\d]+)$/;
var exploreAttributes = Object.keys(request).filter( function(element) {return exploreAttributesPattern.test(element)} );

$('.dialfooter').prepend(
Expand All @@ -96,8 +96,8 @@ chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
result = '';
for (index=0; index<exploreAttributes.length; index++) {
attributeName = exploreAttributes[index];
attributeNameIndex = exploreAttributesPattern.exec(attributeName)[1];
result = result + (request[attributeName] ? '<tr><td width="100px">Attribute '+attributeNameIndex+' (Explore)</td><td>' + request[attributeName] + '</td></tr>' : '');
attributeNameIndex = exploreAttributesPattern.exec(attributeName)[2];
result = result + (request[attributeName] ? '<tr><td width="100px">Attribute '+attributeNameIndex+' (Explore) ('+attributeName+')</td><td>' + request[attributeName] + '</td></tr>' : '');
}
return result;
})() +
Expand Down

0 comments on commit ab9bbab

Please sign in to comment.