Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

DTM Page Load rule firing twice

Avatar

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
jayak13010535
Level 2

09-06-2017

Hi,

We have a page where we dynamically load the dtm footer code and whenever this page loads, all the page load rules (with condition as fires at the bottom of the page) get fired twice. I am not sure what's happening here. This is only happening with the page load rules which get fired at the bottom of the page and all the other rules get fired as expected.

Any pointers will be highly appreciated!

Thanks in advance.

Replies

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

09-06-2017

Hi,

When you say your rule is being fired twice, are you seeing a message in the console with DTM Debug mode turned on indicating the rule fired twice or are you just seeing two identical beacons?

Thanks,
Jantzen

Avatar

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
jayak13010535
Level 2

09-06-2017

Hi Jantzen,

I am using DTM Switcher Debugger mode to see the number of rules getting fired on page load.

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

09-06-2017

Can you include a screenshot of what you're seeing? Also, a URL of where this is occurring would allow me to do a bit more troubleshooting.

Avatar

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
jayak13010535
Level 2

10-06-2017

Hi Jantzen,

You can refer the attached screen shot. After I changed the rules condition to 'DOM Ready', I am able to fire all the rules only once. But, now the major issue is DTM is sending two beacons on this page load. I can see that after all the page load rules gets fired, DTM calls sendBeacon function to send data to Analytics server. However, later when DTM footer code gets included on the page, this also fires another beacon.

I am not sure what exactly is happening here. I tried changing doPlugins function in DTM, but this doesn't make any difference since this whole Analytics Tool setup works perfectly fine on the other pages. This problem exists on only one page. May be because this page has lots of contents to be loaded and takes time to include pageBottom function and this pageBottom function internally makes a call to the sendBeacon function.

1226773_pastedImage_1.png

Please advise.

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

12-06-2017

You said " takes time to include pageBottom function" are you dynamically injecting the DTM Embed code into the page?

Also, do you have a URL where this is taking place? You shouldn't be getting two Analytics tracked a page view messages in the console. That message typically shows when the page load beacon has fired. If it's firing twice, I'd guess there is something going on with the implementation.

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

12-06-2017

Thanks for sending the URL via private message. If possible, including it here publicly allows others to also try and troubleshoot.

I was able to look at the page and viewing the source code I wasn't able to find your DTM footer code "<script type="text/javascript">_satellite.pageBottom();</script>". Is the footer code being dynamically injected in? If so, could this be changed to be included statically like the header embed code?

Avatar

Avatar
Boost 50
Employee
Kaushalendra
Employee

Likes

65 likes

Total Posts

142 posts

Correct Reply

69 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Boost 50
Employee
Kaushalendra
Employee

Likes

65 likes

Total Posts

142 posts

Correct Reply

69 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Kaushalendra
Employee

18-06-2017

Hi jayak13010535​,

If the issue is still not resolved, I would suggest posting the URL along with the steps to replicate the issue so that we can try troubleshooting the issue at our end.

Avatar

Avatar
Shape 1
Level 2
makbeta
Level 2

Likes

7 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Shape 1
Give Back 3
Give Back
Boost 5
Boost 3
View profile

Avatar
Shape 1
Level 2
makbeta
Level 2

Likes

7 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Shape 1
Give Back 3
Give Back
Boost 5
Boost 3
View profile
makbeta
Level 2

11-06-2018

I've ran into the same issue before and here's what I was able to find.

My setup

<head><script src="satellite-code.js</head>

<body>

<script src="scripts-that-sets-digitalData-object-and-fire-an-event-when-ready.js" ></script>

<script type="text/javascript">

     jQuery(document).on('analytics-ready', (function() {

       _satellite.pageBottom();

    });

</script>

What I found is that this setup will always cause the DTM rules to fire twice. Because the logic in DTM code runs as follows:

Fire the rules if you see pageBottom on document load. If the rule wasn't run when the document is ready, DTM will fire the rule on DOM ready.  So it will fire once on DOM ready because pageBottom wasn't yet executed and the second time when my pageBottom function is called after DOM ready.

So pageBottom rule is really pageBottom or DOM ready, whichever comes first.

There is no real good way to tell DTM when the digitalData is ready and fire off the default rule then. 😞

Avatar

Avatar
Validate 1
Level 1
sunilrongali
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
sunilrongali
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
sunilrongali
Level 1

23-07-2018

Is there a solution for this to stop domready event..?