Expand my Community achievements bar.

SOLVED

DCM implementation in DTM

Avatar

Level 1

Hey all,

I am currently working for the first time setting up Google DCM tags. I tried pasting the DCM code as a Third party non-sequential JaveScript through Adobe DTM. The code I used is pasted below:

<!--

Start of DoubleClick Floodlight Tag: Please do not remove

Activity name of this tag: ABCD

URL of the webpage where the tag is expected to be placed: https://www.abcd.com.au/agegate/

This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.

Creation Date: 05/24/2018

-->

<script type="text/javascript">

var axel = Math.random() + "";

var a = axel * 10000000000000;

document.write('<iframe src="https://8573949.fls.doubleclick.net/activityi;src=1234567;type=abcd;cat=test_0;dc_lat=;dc_rdid=;tag_...' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');

</script>

<noscript>

<iframe src="https://8573949.fls.doubleclick.net/activityi;src=1234567;type=abcd;cat=test_0;dc_lat=;dc_rdid=;tag_...?" width="1" height="1" frameborder="0" style="display:none"></iframe>

</noscript>

<!-- End of DoubleClick Floodlight Tag: Please do not remove -->

1. On trying to add this code straight into DTM, I am getting a few errors and the rule cannot be saved. Can anyone please advise the best approach of going about tweaking this code for successful DCM implementation? I have many more requests for DCM implementation and a best approach would help me or the devs tweak the codes for all requests.

2. If I want to set up this code only for a particular landing page, would the best way to go about it be selecting condition and specifying an include path that contains the desired landing page? This should do the job right, or is there any other steps to follow for successful implementation?

Any help would be greatly appreciated. Thanks! [Personal contact info removed - Mod]

1 Accepted Solution

Avatar

Correct answer by
Level 10

It looks like the tag provided by Google is actually an HTML tag. You'll notice the code has a "</script>" tag an other HTML tags within it. Straight Javascript tags do not contain HTML tags most of the time. Try adding the code to the sequential HTML section and having it fire at the top of the page. Alternatively, you could see if Google provides a pure Javascript tag.

As for limiting where this code fires, yes, you can use conditions to limit where the rule fires. Path is probably the easiest condition to do this with.

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

It looks like the tag provided by Google is actually an HTML tag. You'll notice the code has a "</script>" tag an other HTML tags within it. Straight Javascript tags do not contain HTML tags most of the time. Try adding the code to the sequential HTML section and having it fire at the top of the page. Alternatively, you could see if Google provides a pure Javascript tag.

As for limiting where this code fires, yes, you can use conditions to limit where the rule fires. Path is probably the easiest condition to do this with.

Avatar

Level 3

Jantzen.Belliston​ I dont see the option to place the DCM tag in DTM as sequential HTML in the "Event rule" , please see screenshot below:

Screen Shot 2018-08-06 at 2.45.39 PM.png

Avatar

Level 10

You are correct, event based rules do not allow for sequential HTML. Only page load rules allow that option. We typically try to stay away from sequential HTML anyway since it requires a document.write and Chrome has already started to show security warnings to users when document.write is used.

You can either place the code you have into a page load rule with conditions or see if the tag vendor can provide a pure javascript tag for you to use. My recommendation would be the latter.

Avatar

Level 3

Sounds good! I've requested the vendor to provide pure Javascript tags.

Thank you for your insights, it definitely helps us

Avatar

Level 3

May I ask the best practice in case the vendor does not provide a pure Javascript tag? Shall we then place it directly on the site instead of using tag manager?