Expand my Community achievements bar.

Applications for the 2024 Adobe Target Community Mentorship Program are open! Click to the right to learn more about participating as either an Aspirant, to professionally level up with a new Certification, or as a Mentor, to share your Adobe Target expertise and inspire through your leadership! Submit your application today.

Experience custom code runs twice

Avatar

Level 2

I created an activity in Adobe Target that has an Experience that runs 100% to test custom code.  I checked off the box to let the code run in the head.  The custom code is a jQuery document ready that then makes a requireJS call (asynchronous) to load another JS file.  Once that file loads, it executes a console.log message.

I noticed that every time this experience runs, this custom code runs twice, so the console message is shown twice.

I found another thread here dated April 2016 where Adobe staff said there was a bug in Adobe Target, and it would get fixed in May 2016.

Extra link rendering after recent Target updates

It seems this problem still exists for Ajax calls in custom code.  Is there still a problem in Adobe Target?  I had to employ the workaround in that other thread, but I am not satisfied that I have to use this workaround.

10 Replies

Avatar

Level 2

We have same issue.

just upgraded to at.js 2.1.0

We have an A/B test.

All the code does is run a console.log.

We see two console logs trigger.

In other properties where we use at.js 1.x we do not have this problem.

Avatar

Employee

Hi @will.lanni,

Do you have a sample link I can replicate the issue on?

Thanks!

Avatar

Level 2

I will need to get permission to set up a live activity on production so I can share it. I'll post back here when I get that going.

Avatar

Level 2

*headslap* Surebee we won't be able to provide a test until target has been implemented in the environment we're working in and released into production. I'll need to come back to this when we've released.

However, I can say that we implemented the fix from that old thread posted by the OP, and it cut out the second log.

Anyway, I'll set a reminder to come back to this when we have a production version to show.

Avatar

Employee

Right, understood @will.lanni.  I'd like to try and see what the issue is, even though we have a workaround . I will watch for a response from you when you have a production version.

Have a great weekend!

Avatar

Level 2

OK, Surbgupt (hey you changed your username! ), we've deployed our Target installation into production.

Our test is set up as an A/B. Both experiences purely just drop a console.log into the developer console. The default console log is 'tgt-dflt', and the test is 'tgt-tst'.

https://www.endicia.com

If you look, you'll see the little (2) next to the console log, indicating it triggered twice.target-triggers-twice.png

Hope this helps! Let me know if you need any more information.

Avatar

Employee Advisor

hi, will.lanni

Looks like target is getting fired twice on your webpage which will cause all modification hit twice on a page as you can see in following screenshot.

Global Mbox carries and hits all modifications in JSON format on a page when your page loads, here in your case in first hits target loads your custom code and again in the second hit, it'll load same custom code since you are firing mbox twice on a page.

1784553_pastedImage_8.png

thanks,

Gauresh Kodag.

Avatar

Level 2

Thank you Guaresh, I'll open a bug and see if we can figure out what's going on there. Liked/marked helpful.

Avatar

Employee

Hi @will.lani,

Apologies for the delay here!

Thank you for providing this URL, were you able to set up a Client Care ticket?

Either way, I took a look at the URL and see the following:

calls.png

Could you provide more details on what the global-mbox.js file does?

Thanks!