Search code examples
domadobeanalyticsadobe-analyticspage-lifecycle

Adobe analytics - can I call _satellite.pageBottom() on dom ready?


I'm working on a wordpress site, and have been tasked with integrating with Adobe Analytics. The instructions are to include a script at the top of the page:

<script src="//assets.adobedtm.com/3202ba9b02b459ee20779cfcd8e79eaf266be170/satelliteLib-BlaBlaBla.js"></script>

and also to call a function before the closing </body> tag:

<script type="text/javascript">_satellite.pageBottom();</script>

However, due to the nature of wordpress, it's pretty hard to actually enforce that a script is the very last one before the </body> tag. I was thinking of firing the script on DOM ready

$(function(){
    satellite.pageBottom();
});

to ensure that this script gets run after the page has loaded and the other scripts have run. My question is: Is this an appropriate means of running Adobe analytics? I saw that this link here describes the Adobe lifestyle in part, but it doesn't look like it really answers my question: https://marketing.adobe.com/resources/help/en_US/dtm/load_order.html

Cheers


Solution

  • For anyone else facing this issue, the answer is to not try and code your way through, but just to install the Adobe DTM plugin. Classic Wordpress - I should've checked if there was such a plugin at the start!