Expand my Community achievements bar.

SOLVED

hitGovernor Pugin

Avatar

Level 6

I just wanted to get clarification that the instructions and what I did are correct for the hitGovernor plug in. Instructions say to add the part (in bold) to the appMeasurement code. I assume I can copy / paste the whole function in the top of the appmeasurement library however as I read into it more it seems that you take the part I highlighted in yellow and add it to an existing s.registerPostTrackCallback function which I found but it had and a. instead?

1520047_pastedImage_0.png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

I'm pretty sure that in the minimized AppMeasurement code, the internally scoped handle to the 's' object shows up as 'a'. 

I interpret the hitGovernor instructions like this.

Assuming that you are using DTM with the AA Tool or Launch with the AA extension,

In the Tool or Extension configuration, in the custom page code, drop this in:

s.registerPostTrackCallback(function(){

    s.governor();

});

Also, drop this in :

//Hit Governor (Version 0.1 BETA, 11-13-17)

s.governor=new Function("",""

+"var s=this;if(typeof s.hl=='undefined'){s.hl=60;}if(typeof s.ht=='u"

+"ndefined'){s.ht=60;}if(typeof s.he=='undefined'){s.he=60;}if(s.Util"

+".cookieRead('s_hg')==8){var i=new Date(),y=i.getFullYear(),m=i.getM"

+"onth(),d=i.getDate(),i=new Date(y,m,d+s.he);s.Util.cookieWrite('s_h"

+"g',9,i);return;}var f=s.Util.cookieRead('s_hc'),g=Number(s.Util.coo"

+"kieRead('s_ht')),h=Math.floor((new Date()).getTime()),ha=f!=''?f.sp"

+"lit('|').map(Number):[0,0,0,0,0],i=ha.reduce(function(ha,b){return "

+"ha+b;},0),j=g==0?0:Math.floor(((h-g)/(s.ht/6))/1000);if(g==0)s.Util"

+".cookieWrite('s_ht',h);if(i<s.hl){if(j>=1){if(j>=6){ha=[0,0,0,0,0];"

+"}else{for(var k=0;k<j;k++){ha.unshift(0);ha.pop();}}s.Util.cookieWr"

+"ite('s_ht',h);}}else{s.Util.cookieWrite('s_hg',8);s.linkTrackVars+="

+"',contextData.exceptionFlag';s.contextData['exceptionFlag']='true';"

+"s.tl(this,'o','exceptionFlag');}ha[0]++;s.Util.cookieWrite('s_hc',h"

+"a.join('|'));");

The first part (registerPostTrackCallback) instructs AppMeasurement to call s.governor after every beacon is sent to AA.

The second part (//Hit Governor (Version 0.1 BETA, 11-13-17)), is the function itself.

Once this is done, the client side plumbing is in place (optionally modify the config parameters s.hl, s.ht, s.he)

Step 2 of the instructions sets up your analytics to track the exceptions (via processing rules mappings).

Step 3 of the instructions is the optional blocking of the offending actors.  I would do the first two steps, look at the data and then determine if step 3 is warranted.

View solution in original post

2 Replies

Avatar

Level 10

I'm not sure I understand your question completely. According to the instructions, you should find the s.registerPostTrackCallback(function() and you should insert the s.governor(); snippet within that function.

When you say your fiction had a a. instead, are you meaning they've replaced the "s." with "a."? If so, someone may have renamed your tracking variable to 'a' instead of 's'. If that was the case, "a.governor()" should work, assuming they have correctly remapped all instances of the s variable name.

Avatar

Correct answer by
Community Advisor

I'm pretty sure that in the minimized AppMeasurement code, the internally scoped handle to the 's' object shows up as 'a'. 

I interpret the hitGovernor instructions like this.

Assuming that you are using DTM with the AA Tool or Launch with the AA extension,

In the Tool or Extension configuration, in the custom page code, drop this in:

s.registerPostTrackCallback(function(){

    s.governor();

});

Also, drop this in :

//Hit Governor (Version 0.1 BETA, 11-13-17)

s.governor=new Function("",""

+"var s=this;if(typeof s.hl=='undefined'){s.hl=60;}if(typeof s.ht=='u"

+"ndefined'){s.ht=60;}if(typeof s.he=='undefined'){s.he=60;}if(s.Util"

+".cookieRead('s_hg')==8){var i=new Date(),y=i.getFullYear(),m=i.getM"

+"onth(),d=i.getDate(),i=new Date(y,m,d+s.he);s.Util.cookieWrite('s_h"

+"g',9,i);return;}var f=s.Util.cookieRead('s_hc'),g=Number(s.Util.coo"

+"kieRead('s_ht')),h=Math.floor((new Date()).getTime()),ha=f!=''?f.sp"

+"lit('|').map(Number):[0,0,0,0,0],i=ha.reduce(function(ha,b){return "

+"ha+b;},0),j=g==0?0:Math.floor(((h-g)/(s.ht/6))/1000);if(g==0)s.Util"

+".cookieWrite('s_ht',h);if(i<s.hl){if(j>=1){if(j>=6){ha=[0,0,0,0,0];"

+"}else{for(var k=0;k<j;k++){ha.unshift(0);ha.pop();}}s.Util.cookieWr"

+"ite('s_ht',h);}}else{s.Util.cookieWrite('s_hg',8);s.linkTrackVars+="

+"',contextData.exceptionFlag';s.contextData['exceptionFlag']='true';"

+"s.tl(this,'o','exceptionFlag');}ha[0]++;s.Util.cookieWrite('s_hc',h"

+"a.join('|'));");

The first part (registerPostTrackCallback) instructs AppMeasurement to call s.governor after every beacon is sent to AA.

The second part (//Hit Governor (Version 0.1 BETA, 11-13-17)), is the function itself.

Once this is done, the client side plumbing is in place (optionally modify the config parameters s.hl, s.ht, s.he)

Step 2 of the instructions sets up your analytics to track the exceptions (via processing rules mappings).

Step 3 of the instructions is the optional blocking of the offending actors.  I would do the first two steps, look at the data and then determine if step 3 is warranted.