Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

repeating events on direct call after DTM to Launch Migration

Avatar

Avatar
Validate 1
Level 1
jeys72304421
Level 1

Likes

2 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
jeys72304421
Level 1

Likes

2 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
jeys72304421
Level 1

20-03-2019

Hi there,

We have migrated DTM to Launch and testing it. while I am testing the site, I see repeating event string appended to the events variable.

I have main page load event. that set to add event1, event42.

when user scroll down the content, I am calling a direct rule that add additional events (event1, event41, event51, event42). But this direct rule will be triggered again and again when user scroll through the page. It was working fine as expected in DTM. But after migration, when direct rules are called, it is appending events to each calls.

ex:

1st call (pageload): event1,event42

1st direct rule: event1,event42,event1,event41,event51,event42

2nd direct rule: event1,event42,event1,event41,event51,event42,event1,event41,event51,event42

and so on.

How can I eliminating this?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 8
thomas_amsler
Level 8

Likes

241 likes

Total Posts

159 posts

Correct Reply

26 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 8
thomas_amsler
Level 8

Likes

241 likes

Total Posts

159 posts

Correct Reply

26 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
thomas_amsler
Level 8

25-03-2019

First of all: Do your rules have a Clear Variables Action (this is needed in Launch compared to DTM)?

Second: if yes, what version of the Analytics Extension are you using. There seems to be a bug in AppMeasurement.js 2.11.0 which is part of the Extension since 1.6.0 that sometimes doesn't clear events even when using Clear Variables action: What are possible reasons why ClearVariable fails?

If you don't want to clear your variables between these calls, you may have to add custom logic, with code. I am using a simple helper method where the first parameter is s.events and the second a string containing one or more events separated by a comma:

function concatenate(orig, addition) {

   if (typeof orig === 'string' && orig !== '') {

   var concat = orig + ',' + addition;

   var values = concat.split(',');

   return values.filter(function(value, index, self) {

   return self.indexOf(value) === index;

  }).join(',');

  } else {

   return addition;

  }

}

The filter method makes sure that each event is only present once.

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 1
jeys72304421
Level 1

Likes

2 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
jeys72304421
Level 1

Likes

2 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
jeys72304421
Level 1

25-03-2019

thanks thomas.amsler

I figured it out. it was missing Clear Variables Action. your answer will help on this forum.