diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-09-15 14:45:37 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-09-15 14:45:37 +0400 |
commit | d8f547b97e155137bfd2e09c8f81c7d448c6fb4d (patch) | |
tree | c38cfc1aa36587d81e9167adea216cf2660b17f1 /js | |
parent | f68feb02bfd22032d7e83295d25a1cffde0c90c6 (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.js | 26 |
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) |