1

We're struggling into possible DTM Adobe Analytics Tool conditions, in order to let the tool be active only on certain pages.

In fact, tools settings don't allow any Conditions, like Rules instead.

If we flag the "Page code is already present" checkbox, no tool code would be active at all.

Our requirement is that just some pages already have the page code, thus the Adobe Analytics tool would be active just for the other ones.

In short, it would be like the "Page code is already present" checkbox could be conditioned.

We tested some Page-load rules which could fire, conditionally, the tool, but it does not work.

Alex K
  • 8,269
  • 9
  • 39
  • 57
grimmat
  • 11
  • 3
  • The short answer is no, DTM (*still*) does not have a built-in way to conditionally trigger the tool on page load, however, there are some (shady) workarounds. See [this answer](http://stackoverflow.com/questions/26219881/dtm-s-t-function-and-page-load-rules-relation/26227474#26227474) I posted on a related question for more details. – CrayonViolent Jan 25 '15 at 23:32
  • Also, "Page code is already present" option is basically another level of "drafting" stuff in DTM. It is meant for people who already have a legacy imp. on their site and are trying to migrate to DTM. So, it is a way to start implementing it through DTM but not actually have DTM output anything. The idea is that once you have done that, and then also removed all the legacy code from your site, you can uncheck the box and DTM will start outputting it. TBH I'm still trying to figure out why I would ever do this, instead of just not publish changes until I'm ready, but..it is what it is! – CrayonViolent Jan 25 '15 at 23:45
  • In the tool custom code you can write logic to set s.abort to true if other page code exists if the other code has already loaded – BrettAHale Jan 26 '15 at 03:56

2 Answers2

0

Hi and thanks for replying! (i'm the same user who posted),

You all confirmed my thoughts about, especially the need for some workarounds to condition the tool triggering. For the time being, I simply included all my tool content within an "if" clause and so it works.

The possibile use of the s.abort option is interesting but I suppose every call, next to the initial onload, would be stopped if this is set to true.
The DTM tool would be prevented from working, but any Custom Links or user actions generated calls would be blocked.
Is this right?
If so, the "manual" condition of the tool code content seems to be the easiest and quicker solution.

  • 2
    `s.abort` only blocks the *next* `s.t` or `s.tl` call. Internally, AA code resets it to false after the call, so if you make another call after it, it pops. Since you are looking to completely supress AA tracking on a given page, Basically you would have to write your own logic for identifying the page and then set it to true for every ping on that page. For example, since `s_doPlugins` gets popped on every call, you could have something like `if (doNotTrack) { s.abort=true; }` where you separately have logic that sets `doNotTrack` to true if you don't want to track that page. – CrayonViolent Jan 26 '15 at 14:47
  • 2
    IOW, if you set `s.abort` to `true` when library is first loaded, it will block the initial `s.t` call for the normal "page view" tracking. But once the visitor is on the page, you could have any number of things that trigger tracking, e.g. download links. Well, `s.abort` set *once* will only suppress a request to AA *once*. So if you are looking to suppress *all* potential tracking on a given page, you would need to ensure `s.abort` gets set to `true` for *all* potential actions on a given page. Hence my suggestion about putting it in `s_doPlugins`, since that gets called for every call. – CrayonViolent Jan 26 '15 at 14:54
0

As was suggested, if the "Page Code is already on the page" is selected then the Adobe Analytics Tool will not run via DTM.

In your case where essentially different configurations are required to run on different pages, you could consider creating 2 individual properties (one for each configuration) and 1 global property in DTM that would then deploy the specific property header file based on URL.

In essence, you deploy the global header on all pages and then write a script within the global property that would deploy the "child" property script based on URL. Something like:

switch (trimPath) {
// Code present property  
case "myURL.com":
document.write("<script src='//header-code-path-here.js'</scr'+'ipt>");
break;
// Adobe Analytics Tool Property    
case "myOtherURL.com":
document.write("<script src='//header-code-path-here.js'</scr'+'ipt>");
}

Hope this helps.

Mark Stringham
  • 421
  • 3
  • 8