Experience custom code runs twice

Avatar

Avatar
Boost 5
Level 2
stephent5693770
Level 2

Likes

5 likes

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
View profile

Avatar
Boost 5
Level 2
stephent5693770
Level 2

Likes

5 likes

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
View profile
stephent5693770
Level 2

01-02-2018

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.

Replies

Avatar

Avatar
Validate 1
Level 2
will_lanni
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
will_lanni
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
will_lanni
Level 2

07-06-2019

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

Avatar
Coach
Employee
surebee
Employee

Likes

69 likes

Total Posts

83 posts

Correct reply

21 solutions
Top badges earned
Coach
Contributor
Shape 1
Give Back 5
Give Back 3
View profile

Avatar
Coach
Employee
surebee
Employee

Likes

69 likes

Total Posts

83 posts

Correct reply

21 solutions
Top badges earned
Coach
Contributor
Shape 1
Give Back 5
Give Back 3
View profile
surebee
Employee

13-06-2019

Hi @will.lanni,

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

Thanks!

Avatar

Avatar
Validate 1
Level 2
will_lanni
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
will_lanni
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
will_lanni
Level 2

13-06-2019

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

Avatar
Coach
Employee
surebee
Employee

Likes

69 likes

Total Posts

83 posts

Correct reply

21 solutions
Top badges earned
Coach
Contributor
Shape 1
Give Back 5
Give Back 3
View profile

Avatar
Coach
Employee
surebee
Employee

Likes

69 likes

Total Posts

83 posts

Correct reply

21 solutions
Top badges earned
Coach
Contributor
Shape 1
Give Back 5
Give Back 3
View profile
surebee
Employee

13-06-2019

Sounds good, thank you!

Avatar

Avatar
Validate 1
Level 2
will_lanni
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
will_lanni
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
will_lanni
Level 2

13-06-2019

*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

Avatar
Coach
Employee
surebee
Employee

Likes

69 likes

Total Posts

83 posts

Correct reply

21 solutions
Top badges earned
Coach
Contributor
Shape 1
Give Back 5
Give Back 3
View profile

Avatar
Coach
Employee
surebee
Employee

Likes

69 likes

Total Posts

83 posts

Correct reply

21 solutions
Top badges earned
Coach
Contributor
Shape 1
Give Back 5
Give Back 3
View profile
surebee
Employee

14-06-2019

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

Avatar
Validate 1
Level 2
will_lanni
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
will_lanni
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
will_lanni
Level 2

03-07-2019

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

Avatar
Springboard
Level 8
gaureshk3014423
Level 8

Likes

201 likes

Total Posts

168 posts

Correct reply

33 solutions
Top badges earned
Springboard
Validate 1
Contributor
Coach
Shape 10
View profile

Avatar
Springboard
Level 8
gaureshk3014423
Level 8

Likes

201 likes

Total Posts

168 posts

Correct reply

33 solutions
Top badges earned
Springboard
Validate 1
Contributor
Coach
Shape 10
View profile
gaureshk3014423
Level 8

04-07-2019

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

Avatar
Validate 1
Level 2
will_lanni
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
will_lanni
Level 2

Likes

3 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
will_lanni
Level 2

05-07-2019

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