Duplicate events and how it will affect in AA | Community
Skip to main content
Level 3
December 4, 2023
Solved

Duplicate events and how it will affect in AA

  • December 4, 2023
  • 1 reply
  • 1463 views

I have written a code 

s.events = s.events ? s.events + ",event100=” + s._pltLoadtime: "event100=" + s._pltLoadtime ;

in AA extension in configure code,

 

But then when a exit call or download call was firing this event100 is populating like 6 times in a server call , Is this fine or will it affect Analytics( will the analytics detect duplicate).?

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

I have doubt , Since I have told the events are duplicating in exit call and download call. So , it could be that the page is not changing , so the old values are persisting.

But, I highly doubt clear vars would work or not.

What's your thought on this?


If it's in the same call (i.e. exit sending "event100,event100,event100,event100,event100,event100" for instance), then no, clear vars won't help...

 

Think of Launch like a series of actions that perform parts of the code...

 

Let's say "part c" is setting your events, and "part x" is the final piece that sends the tracking call...

 

The order doesn't matter, so long as "part x" is last, so in an efficient system, you might have:

 

  • part a
  • part c
  • part b
  • part d
  • part y
  • part x

 

However, it looks like your "part c" is getting called multiple times:

  • part a
  • part c
  • part b
  • part c
  • part d
  • part c
  • ...
  • part x

 

Each time "part c" is run, it's appending another version of event100 into your events list...

 

Here is the next question, if your event100 is "Load Time", why is it sending on Exit and Download actions? It really should only be set on page views... since this is supposed to measure how long it took the page to load..  triggering actions like exits or downloads shouldn't contain that value at all, there's no context in which that makes sense... 

 

However, it is possible that the the values from the page load are spilling over into your exit / download links... using ClearVars would in theory prevent the page's "event100" from carrying forward to the actions.... but the actions shouldn't be setting it at all (and if they are, then that could result in two event100s... but not six....)

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
December 4, 2023

I think this will be treated as additional calls... I recall someone a while ago mention a scenario where one particular user was firing the same event hundreds of times in the same call ("eventx,eventx,eventx,....") and it was causing issues...

 

It sounds like were you have your code:

s.events = s.events ? s.events + ",event100=” + s._pltLoadtime: "event100=" + s._pltLoadtime ;

 

is in the wrong place, something that is being executed multiple times when the page is loaded...


You should try to figured out why that is happening an move this somewhere more reasonable.. 

 

Even if only to make your implementation more streamlined and efficient... but I also feel this will impact your data... so it's really important to fix.

SA30Author
Level 3
December 4, 2023

Hi can I use 

s.events = apl(s.events,",event100=” + s._pltLoadtime)

Will this work?

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
December 4, 2023

I'm 99% sure you will end up with the same problem... 

 

That code is just a "fancier" way to append more values onto the end of s.events....

 

In both cases, new versions of event100 will be added to your s.events variable multiple times...

 

This is an issue with where you are calling the code, not the code itself.

 

I use code like
s.events = s.events ? s.events + ",eventx” : "eventx";

in my code all the time, and I never encounter the issue you did.