Question about JavaScript use in Adobe Target Campaigns | Community
Skip to main content
Level 3
June 14, 2023
Question

Question about JavaScript use in Adobe Target Campaigns

  • June 14, 2023
  • 0 replies
  • 530 views

I'm trying to add some custom JavaScript via Adobe Target for an A/B test.  I have a simple countdown timer in JS that runs great via my codepen. The problem is that it seems that Adobe Target loads the experience a bit late.  Due to the need for page load improvements the Adobe Target script is implemented in the <body>, not the <head> of the site. (Yes, I know.. but I'm just a small cog in the machine.)

 

Are there any trick or techniques that I can use to get the script to load more efficiently?  I've tried a MutationObserver,  'window.onload = function()' and DOMContentLoaded  - but nothing seems to help.  The timer outputs like this when running via Target:

When it should be like this based on my script:

 

Any insights on a solution is appreciated.

 

 

 

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