Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-09-15 14:45:37 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-09-15 14:45:37 +0400
commitd8f547b97e155137bfd2e09c8f81c7d448c6fb4d (patch)
treec38cfc1aa36587d81e9167adea216cf2660b17f1 /js
parentf68feb02bfd22032d7e83295d25a1cffde0c90c6 (diff)
refs #4996 make sure we always track same content name and piece in an interaction and also have to use default values
Diffstat (limited to 'js')
-rw-r--r--js/piwik.js26
1 files changed, 19 insertions, 7 deletions
diff --git a/js/piwik.js b/js/piwik.js
index adb95ef11b..5a9cddfa4b 100644
--- a/js/piwik.js
+++ b/js/piwik.js
@@ -3321,9 +3321,15 @@ if (typeof Piwik !== 'object') {
return false;
}
- var contentName = content.findContentName(contentBlock);
- var contentPiece = content.findContentPiece(contentBlock);
- var contentTarget = content.findContentTarget(contentBlock);
+ var block = content.buildContentBlock(contentBlock);
+
+ if (!block) {
+ return;
+ }
+
+ var contentName = block.name;
+ var contentPiece = block.piece;
+ var contentTarget = block.target;
if (!query.hasNodeAttributeWithValue(targetNode, content.CONTENT_TARGET_ATTR) || targetNode.wasContentTargetAttrReplaced) {
// make sure we still track the correct content target when an interaction is happening
@@ -3399,9 +3405,16 @@ if (typeof Piwik !== 'object') {
return 'href';
}
- var contentName = content.findContentName(contentBlock);
- var contentPiece = content.findContentPiece(contentBlock);
- var contentTarget = content.findContentTarget(contentBlock);
+
+ var block = content.buildContentBlock(contentBlock);
+
+ if (!block) {
+ return;
+ }
+
+ var contentName = block.name;
+ var contentPiece = block.piece;
+ var contentTarget = block.target;
// click on any non link element, or on a link element that has not an href attribute or on an anchor
var request = buildContentInteractionRequest('click', contentName, contentPiece, contentTarget);
@@ -3409,7 +3422,6 @@ if (typeof Piwik !== 'object') {
return request;
};
-
}
function setupInteractionsTracking(contentNodes)