DTM Page Load rule firing twice | Community
Skip to main content
Level 3
June 9, 2017

DTM Page Load rule firing twice

  • June 9, 2017
  • 2 replies
  • 16230 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

jantzen_b
Adobe Employee
Adobe Employee
June 9, 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

Level 3
June 9, 2017

Hi Jantzen,

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

jantzen_b
Adobe Employee
Adobe Employee
June 9, 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.

makbeta
Level 2
June 11, 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. :-(

July 24, 2018

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

makbeta
Level 2
July 24, 2018

sunilrongali,

There is no way to stop the DOM ready event. The approach is to to disable the standard page load rule and use direct call rule to  track page views.