In our DTM implementation, we're using an old hosted s_code alongside DTM. We're using a data layer throughout the site, but on our CQ (content) side, the data layer population is based on an AJAX call that doesn't happen until DOM Ready - by that time, DTM has already fired.
My pageload rule is capturing everything on our commerce side without incident, but the CQ side will not pass the data in the data layer. We tried delaying the pageBottom call, but that just created 2 image requests. Moving the pageload from Bottom to Onload prevented any variables configured via DTM to pass.
Has anyone run into anything similar?
Chad, for Ajax sequences, you can include a call to
to trigger data collection at the precise point in your Ajax code when you know the request object will be complete. In other words, you'll pick up the data from the data layer when it's available, and set your Analytics variables in the Direct Call Rule.
The entire data layer does not populate after the load event on every page. Some of the data layer is loaded earlier and is being collected just fine. We have a content side of the site (CQ) and a commerce side. The commerce side seems to create the data layer variables and pass them ok. The CQ side does not.
Hey Chad, does your entire data layer populate after the load event on every page of your site?
You can avoid double beacons with a
and in the body of the Direct Call Rule, make your variable assignments.
Obviously, this approach doesn't scale well, so if your entire data layer is only populated after the load event, there are better overall solutions.
If we implement this way, would we run the risk of double tracking on the page?