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
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-09-14 19:38:11 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-09-14 19:38:11 +0400
commitb77da57fc5f596ef3e5eaea206f919b22002990f (patch)
treea40a1fe122e5c3fbe18832c5a98b7bf5e5296f46
parent5477eb9404a5fe35d8804e9b4d300294c9c1d4b5 (diff)
refs #4996 in case we are in an overlay session we should not track. Check could be maybe moved to trackCallback in general?
-rw-r--r--js/piwik.js23
-rw-r--r--misc/internal-docs/content-tracking.md2
-rw-r--r--piwik.js8
3 files changed, 27 insertions, 6 deletions
diff --git a/js/piwik.js b/js/piwik.js
index b375e1a70f..7312c7f8c3 100644
--- a/js/piwik.js
+++ b/js/piwik.js
@@ -4708,6 +4708,10 @@ if (typeof Piwik !== 'object') {
},
trackAllContentImpressions: function () {
+ if (isOverlaySession(configTrackerSiteId)) {
+ return;
+ }
+
trackCallback(function () {
trackCallbackOnReady(function () {
// we have to wait till DOM ready
@@ -4720,6 +4724,9 @@ if (typeof Piwik !== 'object') {
},
trackVisibleContentImpressions: function (checkOnSroll, timeIntervalInMs) {
+ if (isOverlaySession(configTrackerSiteId)) {
+ return;
+ }
if (!isDefined(checkOnSroll)) {
checkOnSroll = true;
@@ -4744,6 +4751,10 @@ if (typeof Piwik !== 'object') {
// it must be a node that is set to .piwikTrackContent or [data-track-content] or one of its parents nodes
trackContentImpression: function (contentName, contentPiece, contentTarget) {
+ if (isOverlaySession(configTrackerSiteId)) {
+ return;
+ }
+
if (!contentName) {
return;
}
@@ -4759,6 +4770,10 @@ if (typeof Piwik !== 'object') {
// it must be a node that is set to .piwikTrackContent or [data-track-content] or one of its parents nodes
// we might remove this method again
trackContentImpressionsWithinNode: function (domNode) {
+ if (isOverlaySession(configTrackerSiteId)) {
+ return;
+ }
+
trackCallback(function () {
if (isTrackOnlyVisibleContentEnabled) {
trackCallbackOnLoad(function () {
@@ -4782,6 +4797,10 @@ if (typeof Piwik !== 'object') {
// name and piece has to be same as previously used on an impression
trackContentInteraction: function (contentInteraction, contentName, contentPiece, contentTarget) {
+ if (isOverlaySession(configTrackerSiteId)) {
+ return;
+ }
+
if (!contentInteraction || !contentName) {
return;
}
@@ -4796,6 +4815,10 @@ if (typeof Piwik !== 'object') {
// it must be a node that is set to .piwikTrackContent or [data-track-content] or one of its parents nodes
// we might remove this method again
trackContentInteractionNode: function (domNode, contentInteraction) {
+ if (isOverlaySession(configTrackerSiteId)) {
+ return;
+ }
+
trackCallback(function () {
var request = buildContentInteractionRequestNode(domNode, contentInteraction);
sendRequest(request, configTrackerPause);
diff --git a/misc/internal-docs/content-tracking.md b/misc/internal-docs/content-tracking.md
index f09a237aa1..37cadc0005 100644
--- a/misc/internal-docs/content-tracking.md
+++ b/misc/internal-docs/content-tracking.md
@@ -429,8 +429,6 @@ Yes it seems most logical to create an action entry for each Content.
Nothing special here I think. We would probably automatically detect the type of content (image, video, text, sound, ...) depending on the content eg in case it ends with [.jpg, .png, .gif] it could be recognized as image content and show a banner in the report.
## TODO
-* Would content impressions be tracked in overlay session?
- * Overlay session should not trigger a content impression
* Cache allowed site urls for redirects
* When a user clicks on an interaction, we should check whether we have already tracked the impression as the content is visible now. If not tracked before, we should track the impression as well
* There can be a scroll or timer event that detects the same content became visible as well. This would not be a problem since we do not track same content block twice
diff --git a/piwik.js b/piwik.js
index 842d4ada10..3bc0a13a92 100644
--- a/piwik.js
+++ b/piwik.js
@@ -45,9 +45,9 @@ b3++){if(u.addEventListener){u.addEventListener(b5[b3],b2)}else{G.attachEvent("o
},getAttributionCampaignName:function(){return X()[0]},getAttributionCampaignKeyword:function(){return X()[1]},getAttributionReferrerTimestamp:function(){return X()[2]},getAttributionReferrerUrl:function(){return X()[3]},setTrackerUrl:function(b2){aa=b2},setSiteId:function(b2){bM=b2},setUserId:function(b2){aI=b2},setCustomData:function(b2,b3){if(J(b2)){an=b2}else{if(!an){an={}}an[b2]=b3}},getCustomData:function(){return an},setCustomRequestProcessing:function(b2){au=b2},appendToTrackingUrl:function(b2){bj=b2},getRequest:function(b2){return aR(b2)},addPlugin:function(b2,b3){a[b2]=b3},setCustomVariable:function(b3,b2,b6,b4){var b5;if(!w(b4)){b4="visit"}if(!w(b2)){return}if(!w(b6)){b6=""}if(b3>0){b2=!n(b2)?String(b2):b2;b6=!n(b6)?String(b6):b6;b5=[b2.slice(0,bQ),b6.slice(0,bQ)];if(b4==="visit"||b4===2){Z();ag[b3]=b5}else{if(b4==="page"||b4===3){bb[b3]=b5}else{if(b4==="event"){ab[b3]=b5}}}}},getCustomVariable:function(b3,b4){var b2;if(!w(b4)){b4="visit"}if(b4==="page"||b4===3){b2=bb[b3]}else{if(b4==="event"){b2=ab[b3]
}else{if(b4==="visit"||b4===2){Z();b2=ag[b3]}}}if(!w(b2)||(b2&&b2[0]==="")){return false}return b2},deleteCustomVariable:function(b2,b3){if(this.getCustomVariable(b2,b3)){this.setCustomVariable(b2,"","",b3)}},storeCustomVariablesInCookie:function(){a3=true},setLinkTrackingTimer:function(b2){bi=b2},setDownloadExtensions:function(b2){aS=b2},addDownloadExtensions:function(b2){aS+="|"+b2},setDomains:function(b2){bk=n(b2)?[b2]:b2;bk.push(bG)},setIgnoreClasses:function(b2){ai=n(b2)?[b2]:b2},setRequestMethod:function(b2){bn=b2||bl},setRequestContentType:function(b2){aJ=b2||a7},setReferrerUrl:function(b2){bp=b2},setCustomUrl:function(b2){a4=bF(bW,b2)},setDocumentTitle:function(b2){aQ=b2},setAPIUrl:function(b2){ax=b2},setDownloadClasses:function(b2){ba=n(b2)?[b2]:b2},setLinkClasses:function(b2){aC=n(b2)?[b2]:b2},setCampaignNameKey:function(b2){aW=n(b2)?[b2]:b2},setCampaignKeywordKey:function(b2){aN=n(b2)?[b2]:b2},discardHashTag:function(b2){ak=b2},setCookieNamePrefix:function(b2){bU=b2;ag=ar()},setCookieDomain:function(b2){aq=y(b2);
bf()},setCookiePath:function(b2){bV=b2;bf()},setVisitorCookieTimeout:function(b2){aw=b2*1000},setSessionCookieTimeout:function(b2){az=b2*1000},setReferralCookieTimeout:function(b2){a6=b2*1000},setConversionAttributionFirstReferrer:function(b2){a2=b2},disableCookies:function(){ao=true;bN.cookie="0"},deleteCookies:function(){W()},setDoNotTrack:function(b3){var b2=e.doNotTrack||e.msDoNotTrack;bP=b3&&(b2==="yes"||b2==="1");if(bP){this.disableCookies()}},addListener:function(b3,b2){bv(b3,b2)},enableLinkTracking:function(b2){if(p){a8(b2)}else{E.push(function(){a8(b2)})}},enableJSErrorTracking:function(){if(bZ){return}bZ=true;var b2=G.onerror;G.onerror=function(b7,b5,b4,b6,b3){aK(function(){var b8="JavaScript Errors";var b9=b5+":"+b4;if(b6){b9+=":"+b6}al(b8,b9,b7)});if(b2){return b2(b7,b5,b4,b6,b3)}return false}},disablePerformanceTracking:function(){aZ=false},setGenerationTimeMs:function(b2){aH=parseInt(b2,10)},setHeartBeatTimer:function(b4,b3){var b2=new Date();aj=b2.getTime()+b4*1000;aF=b3*1000
-},killFrame:function(){if(G.location!==G.top.location){G.top.location=G.location}},redirectFile:function(b2){if(G.location.protocol==="file:"){G.location=b2}},setCountPreRendered:function(b2){aY=b2},trackGoal:function(b2,b4,b3){aK(function(){bg(b2,b4,b3)})},trackLink:function(b3,b2,b5,b4){aK(function(){bI(b3,b2,b5,b4)})},trackPageView:function(b2,b3){ah=[];if(A(bM)){aK(function(){M(aa,ax,bM)})}else{aK(function(){a9(b2,b3)})}},trackAllContentImpressions:function(){aK(function(){aA(function(){var b2=m.findContentNodes();var b3=aU(b2);ap(b3,bi)})})},trackVisibleContentImpressions:function(b2,b3){if(!w(b2)){b2=true}if(!w(b3)){b3=750}bq(b2,b3,this);aK(function(){aO(function(){var b4=m.findContentNodes();var b5=bw(b4);ap(b5,bi)})})},trackContentImpression:function(b4,b2,b3){if(!b4){return}b2=b2||"Unknown";aK(function(){var b5=bH(b4,b2,b3);aX(b5,bi)})},trackContentImpressionsWithinNode:function(b2){aK(function(){if(ay){aO(function(){var b3=m.findContentNodesWithinNode(b2);var b4=bw(b3);ap(b4,bi)
-})}else{aA(function(){var b3=m.findContentNodesWithinNode(b2);var b4=aU(b3);ap(b4,bi)})}})},trackContentInteraction:function(b4,b5,b2,b3){if(!b4||!b5){return}b2=b2||"Unknown";aK(function(){var b6=bY(b4,b5,b2,b3);aX(b6,bi)})},trackContentInteractionNode:function(b3,b2){aK(function(){var b4=aT(b3,b2);aX(b4,bi)})},trackEvent:function(b3,b5,b2,b4){aK(function(){al(b3,b5,b2,b4)})},trackSiteSearch:function(b2,b4,b3){aK(function(){aL(b2,b4,b3)})},setEcommerceView:function(b5,b2,b4,b3){if(!w(b4)||!b4.length){b4=""}else{if(b4 instanceof Array){b4=JSON2.stringify(b4)}}bb[5]=["_pkc",b4];if(w(b3)&&String(b3).length){bb[2]=["_pkp",b3]}if((!w(b5)||!b5.length)&&(!w(b2)||!b2.length)){return}if(w(b5)&&b5.length){bb[3]=["_pks",b5]}if(!w(b2)||!b2.length){b2=""}bb[4]=["_pkn",b2]},addEcommerceItem:function(b6,b2,b4,b3,b5){if(b6.length){bz[b6]=[b6,b2,b4,b3,b5]}},trackEcommerceOrder:function(b2,b6,b5,b4,b3,b7){bD(b2,b6,b5,b4,b3,b7)},trackEcommerceCartUpdate:function(b2){bT(b2)}}}function v(){return{push:R}}U(G,"beforeunload",S,false);
-o();Date.prototype.getTimeAlias=Date.prototype.getTime;L=new D();var r={setTrackerUrl:1,setAPIUrl:1,setSiteId:1,disableCookies:1};var d;for(t=0;t<_paq.length;t++){d=_paq[t][0];if(r[d]){R(_paq[t]);delete _paq[t];if(r[d]>1){if(console!==undefined&&console&&console.error){console.error("The method "+d+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Piwik trackers documentation: http://developer.piwik.org/api-reference/tracking-javascript#multiple-piwik-trackers')}}r[d]++}}for(t=0;t<_paq.length;t++){if(_paq[t]){R(_paq[t])}}_paq=new v();c={addPlugin:function(W,X){a[W]=X},getTracker:function(W,X){return new D(W,X)},getAsyncTracker:function(){return L}};if(typeof define==="function"&&define.amd){define("piwik",[],function(){return c})}return c}())}if(window&&window.piwikAsyncInit){window.piwikAsyncInit()}(function(){var a=(typeof AnalyticsTracker);if(a==="undefined"){AnalyticsTracker=Piwik}}());if(typeof piwik_log!=="function"){piwik_log=function(b,f,d,g){function a(h){try{return eval("piwik_"+h)
-}catch(i){}return}var c,e=Piwik.getTracker(d,f);e.setDocumentTitle(b);e.setCustomData(g);c=a("tracker_pause");if(c){e.setLinkTrackingTimer(c)}c=a("download_extensions");if(c){e.setDownloadExtensions(c)}c=a("hosts_alias");if(c){e.setDomains(c)}c=a("ignore_classes");if(c){e.setIgnoreClasses(c)}e.trackPageView();if(a("install_tracker")){piwik_track=function(i,k,j,h){e.setSiteId(k);e.setTrackerUrl(j);e.trackLink(i,h)};e.enableLinkTracking()}};
+},killFrame:function(){if(G.location!==G.top.location){G.top.location=G.location}},redirectFile:function(b2){if(G.location.protocol==="file:"){G.location=b2}},setCountPreRendered:function(b2){aY=b2},trackGoal:function(b2,b4,b3){aK(function(){bg(b2,b4,b3)})},trackLink:function(b3,b2,b5,b4){aK(function(){bI(b3,b2,b5,b4)})},trackPageView:function(b2,b3){ah=[];if(A(bM)){aK(function(){M(aa,ax,bM)})}else{aK(function(){a9(b2,b3)})}},trackAllContentImpressions:function(){if(A(bM)){return}aK(function(){aA(function(){var b2=m.findContentNodes();var b3=aU(b2);ap(b3,bi)})})},trackVisibleContentImpressions:function(b2,b3){if(A(bM)){return}if(!w(b2)){b2=true}if(!w(b3)){b3=750}bq(b2,b3,this);aK(function(){aO(function(){var b4=m.findContentNodes();var b5=bw(b4);ap(b5,bi)})})},trackContentImpression:function(b4,b2,b3){if(A(bM)){return}if(!b4){return}b2=b2||"Unknown";aK(function(){var b5=bH(b4,b2,b3);aX(b5,bi)})},trackContentImpressionsWithinNode:function(b2){if(A(bM)){return}aK(function(){if(ay){aO(function(){var b3=m.findContentNodesWithinNode(b2);
+var b4=bw(b3);ap(b4,bi)})}else{aA(function(){var b3=m.findContentNodesWithinNode(b2);var b4=aU(b3);ap(b4,bi)})}})},trackContentInteraction:function(b4,b5,b2,b3){if(A(bM)){return}if(!b4||!b5){return}b2=b2||"Unknown";aK(function(){var b6=bY(b4,b5,b2,b3);aX(b6,bi)})},trackContentInteractionNode:function(b3,b2){if(A(bM)){return}aK(function(){var b4=aT(b3,b2);aX(b4,bi)})},trackEvent:function(b3,b5,b2,b4){aK(function(){al(b3,b5,b2,b4)})},trackSiteSearch:function(b2,b4,b3){aK(function(){aL(b2,b4,b3)})},setEcommerceView:function(b5,b2,b4,b3){if(!w(b4)||!b4.length){b4=""}else{if(b4 instanceof Array){b4=JSON2.stringify(b4)}}bb[5]=["_pkc",b4];if(w(b3)&&String(b3).length){bb[2]=["_pkp",b3]}if((!w(b5)||!b5.length)&&(!w(b2)||!b2.length)){return}if(w(b5)&&b5.length){bb[3]=["_pks",b5]}if(!w(b2)||!b2.length){b2=""}bb[4]=["_pkn",b2]},addEcommerceItem:function(b6,b2,b4,b3,b5){if(b6.length){bz[b6]=[b6,b2,b4,b3,b5]}},trackEcommerceOrder:function(b2,b6,b5,b4,b3,b7){bD(b2,b6,b5,b4,b3,b7)},trackEcommerceCartUpdate:function(b2){bT(b2)
+}}}function v(){return{push:R}}U(G,"beforeunload",S,false);o();Date.prototype.getTimeAlias=Date.prototype.getTime;L=new D();var r={setTrackerUrl:1,setAPIUrl:1,setSiteId:1,disableCookies:1};var d;for(t=0;t<_paq.length;t++){d=_paq[t][0];if(r[d]){R(_paq[t]);delete _paq[t];if(r[d]>1){if(console!==undefined&&console&&console.error){console.error("The method "+d+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Piwik trackers documentation: http://developer.piwik.org/api-reference/tracking-javascript#multiple-piwik-trackers')}}r[d]++}}for(t=0;t<_paq.length;t++){if(_paq[t]){R(_paq[t])}}_paq=new v();c={addPlugin:function(W,X){a[W]=X},getTracker:function(W,X){return new D(W,X)},getAsyncTracker:function(){return L}};if(typeof define==="function"&&define.amd){define("piwik",[],function(){return c})}return c}())}if(window&&window.piwikAsyncInit){window.piwikAsyncInit()}(function(){var a=(typeof AnalyticsTracker);if(a==="undefined"){AnalyticsTracker=Piwik
+}}());if(typeof piwik_log!=="function"){piwik_log=function(b,f,d,g){function a(h){try{return eval("piwik_"+h)}catch(i){}return}var c,e=Piwik.getTracker(d,f);e.setDocumentTitle(b);e.setCustomData(g);c=a("tracker_pause");if(c){e.setLinkTrackingTimer(c)}c=a("download_extensions");if(c){e.setDownloadExtensions(c)}c=a("hosts_alias");if(c){e.setDomains(c)}c=a("ignore_classes");if(c){e.setIgnoreClasses(c)}e.trackPageView();if(a("install_tracker")){piwik_track=function(i,k,j,h){e.setSiteId(k);e.setTrackerUrl(j);e.trackLink(i,h)};e.enableLinkTracking()}};
/*! @license-end */
}; \ No newline at end of file