James Dewes
James Dewes

Reputation: 387

Adobe DTM sequential JavaScript (onload) runs in debug but not live

I have a custom JavaScript tracking tag in Adobe DTM that is set to fire Onload with a path include rule. I am testing in Chrome and the tag code runs in the Chrome console without an error. I am meeting all the conditions for it to fire.

When the Adobe DTM switch plugin staging setting is set to ON I get a network request to the tracking domain, which is the end goal of the script. The the rule has been approved but if I set staging to OFF and reload the page nothing happens.

I have used empty cache and hard reload multiple times and checked that _satellite.buildDate and _satellite.publishDate are both up to date. I don't have control over the approval.

The script itself is creating an iframe. I have paraphrased the core parts here

$("body").append("<div style='display: none;' id='theDiv'></div>")
var targetURL = window.location.protocol + "//anydomain.co.uk";
var frame = document.createElement('iframe');
frame.name = 'the_frame';
frame.src = targetURL;
$("#theDiv").append(frame);

Has anyone seen or heard of anything like this before? Are there any differences between how iframes are dealt with in staging and live? I know there is a dependency on jQuery, but I am not seeing a "$ is not defined" error from satellite.

Upvotes: 0

Views: 706

Answers (1)

CrayonViolent
CrayonViolent

Reputation: 32517

"Approving" something is not the same thing as "Publishing" something. DTM has an extra step between "save" and "publish" to offer a more flexible/robust permission system for making and publishing changes. For smaller companies or individuals where there are only 1 or 2 people who have access to DTM (and usually everybody is an admin), it's kind of overkill.

But this is usually a huge deal for larger companies with a lot of people with dtm access doing their own thing with little or no awareness of each other.

It's all about controlling how many people or who all can push stuff onto your site. For example it is not uncommon for larger companies to have a first level dev team to do the initial work (tool setup, add a new tag, whatever). Or even many people or teams, each with access to DTM. Then there may be another (usually single) team in charge of approving the changes (make sure everything looks legit, doesn't break other things on the site, etc.), then maybe have even less people (again, usually a single team or individual) with access to actually pull the trigger and publish it.

How the publishing flow works

When you first create a rule or tool, or when you modify or remove an existing rule/tool and save it, it goes into the Approval queue. At this point, the change is unpublished. You can view the change on your site if the site has the DTM staging script tag on it, or by putting the production script tag into stage mode (e.g. with the DTM Switch plugin you are using).

Once you are happy with the change(s), you can go to the Approval queue (the Approvals tab and approve the change(s). This will push the change(s) to the Publish queue. At this point, the change(s) are still not published. So, if you are using the production dtm tag and it is not in stage mode (e.g. you turned off Switch), you will not see the change(s).

To see the changes on your live site using the production dtm tag (not in stage mode), you must go to the Publish queue, select the item(s) you want to publish, and push the publish button there.

But it sounds like your user account (or group) does not have Publish privileges, so you will need to ask someone who does have Publish privileges to do it for you.

Upvotes: 4

Related Questions