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-19 18:04:15 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-09-19 18:04:15 +0400
commit791eef553cfc4ee0895859af232a5e42c1de7fc3 (patch)
tree1f4310597ec013e3bef8816e8c1c22b5ee435d52 /js
parent4d1bf6dd9bca134ea0894675f21d9b2fb27c5393 (diff)
refs #4996 there is a difference between link tracking enabled and installed. When replacing the initial link urls link tracking might not be installed yet but enabled (will be installed on load event). When a click is happening on a content block we still need to use linkTrackingInstalled since then the credirect/tracking request is actually happening and we need to know whether outlink/download will track it or whether we have to do it separately. Make sure to call enableLinkTracking before trackContentImpressions although there should be no huge difference as both will be delayed until ready/load event anyway
Diffstat (limited to 'js')
-rw-r--r--js/piwik.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/js/piwik.js b/js/piwik.js
index 46a31a0602..471e06ed4c 100644
--- a/js/piwik.js
+++ b/js/piwik.js
@@ -2269,6 +2269,7 @@ if (typeof Piwik !== 'object') {
// Guard against installing the link tracker more than once per Tracker instance
linkTrackingInstalled = false,
+ linkTrackingEnabled = false,
// Guard against installing the activity tracker more than once per Tracker instance
activityTrackingInstalled = false,
@@ -3306,9 +3307,9 @@ if (typeof Piwik !== 'object') {
}
var link = getLinkIfShouldBeProcessed(targetNode);
- if (linkTrackingInstalled && link && link.type) {
+ if (linkTrackingEnabled && link && link.type) {
- return false; // it is an outlink or download.
+ return false; // will be handled via outlink or download.
}
if (query.isLinkElement(targetNode) &&
@@ -4004,6 +4005,7 @@ if (typeof Piwik !== 'object') {
},
disableLinkTracking: function () {
linkTrackingInstalled = false;
+ linkTrackingEnabled = false;
},
/*</DEBUG>*/
@@ -4563,6 +4565,8 @@ if (typeof Piwik !== 'object') {
* @param bool enable If true, use pseudo click-handler (mousedown+mouseup)
*/
enableLinkTracking: function (enable) {
+ linkTrackingEnabled = true;
+
if (hasLoaded) {
// the load event has already fired, add the click listeners now
addClickListeners(enable);
@@ -4896,6 +4900,8 @@ if (typeof Piwik !== 'object') {
},
/**
+ * Tracks an interaction with the given DOM node / content block.
+ *
* By default we track interactions on click but sometimes you might want to track interactions yourself.
* For instance you might want to track an interaction manually on a double click or a form submit.
* Make sure to disable the automatic interaction tracking in this case by specifying either the CSS
@@ -5065,7 +5071,7 @@ if (typeof Piwik !== 'object') {
asyncTracker = new Tracker();
- var applyFirst = {setTrackerUrl: 1, setAPIUrl: 1, setSiteId: 1, disableCookies: 1};
+ var applyFirst = {setTrackerUrl: 1, setAPIUrl: 1, setSiteId: 1, disableCookies: 1, enableLinkTracking: 1};
var methodName;
// find the call to setTrackerUrl or setSiteid (if any) and call them first