Expand my Community achievements bar.

SOLVED

DTM - s.tl calls sent multiple times

Avatar

Level 1

Hi guys. We are trying to send multiple Adobe Analytics events at a time (via Direct Rule) and what we've seen is that these events are queued and then executed all at the same time (with the data elements of the last one). Is there any way to send the events one by one immediately (synchronously) after they've been triggered?

Thanks a lot for your help!

1 Accepted Solution

Avatar

Correct answer by
Level 10

It sounds like you need to clear out the variables. Since your framework doesn't reload the page, the Analytics object is never reset. I'd suggest playing around with the s.clearVars() function.

View solution in original post

8 Replies

Avatar

Level 10

A direct call rule will fire when it is called via the _satellite.track() call.

Can you give me more details about your use case? If you are trying to send multiple events, you should be able to send each event once per call. Each rule would correspond to either a single call or no call.

Avatar

Level 1

Hi Jantzen,

I'll try to explain the implementation we've done and the use case.

We've got some forms where users put their data and we want to track the errors for each field of that forms. Let's say that a user left 3 obligatory fields blank. In this case we would like to send 3 events, each one with different values for the eVars which describe the name of the field.

In order to send the events to Adobe Analytics, we use a direct call rule where we have custom javascript code sending the s.tl call.

On the page we are using this function where we set data elements and fire the direct rule:

<script>

  function eventsDTM(eventCategory, eventAction, eventLabel) {

_satellite.setVar({cat:eventCategory, act:eventAction,  label:eventLabel});

      _satellite.track('scEvent');

  }

</script>

These data elements are then passed to eVars in the javascript custom code of the direct rule.

We've seen that the data elements are getting correct values in each case, but then when the s.tl calls are executed they send the last value of the data elements. So in the end we get to fire 3 events, but with the same eVars.

Let me know if you need more details.

Thanks!!

Avatar

Level 10

Thanks for the additional context. It sounds like the easiest way to accomplish this would be to create an array that contains a list of each of the obligatory fields via data element or other means. Once you've built the javascript array, you could loop through it setting the event variable and evars appropriately and fire off the _satellite.track call with each iteration of the loop.

You mentioned you are seeing 3 calls but they all contain the same data. This might be a setting for the data element or a timing issue. Have you verified that the logic in your code follows this process?

  1. Set variables
  2. Fire first beacon
  3. Set variables
  4. Fire second beacon
  5. Set variables
  6. Fire third beacon

This use case gets a bit tricky because we are relying on DTM for parts and custom code for other parts. Things are a bit more simple when DTM and the UI are used to fire rules or all custom code. Hopefully, with a bit of troubleshooting and trial and error we can come up with a solution.

Avatar

Employee

barbarap51764366​,

Do you have some code or screenshots that you could show (removing any sensitive or account specific data from the code)? 

Avatar

Level 10

barbarap51764366 - Were you able to find an answer to your question?

Avatar

Level 2

Hello,

Im having a similar problem. Im working in a form in ajax and since there are no pageviews or DOM reload I have configured 3 direct calls to fire 3 different events. The direct calls are firing correctly but the events are getting aggregated everytime a direct call is fired. Example:

This is what is happening:

Form page nº 1 -> Direct Call 1 -> event 1

Form page nº 2 -> Direct Call 2 -> event 1 and event 2

Form page nº 3 -> Direct Call 3 -> event 1, event 2 and event 3

This is what we want:

Form page nº 1 -> Direct Call 1 -> event 1

Form page nº 2 -> Direct Call 2 -> event 2

Form page nº 3 -> Direct Call 3 -> event 3

Any clues why this is happening? Maybe because the datalayer is getting multiple pagenames defined everytime a direct call is fired?

Thanks

Avatar

Correct answer by
Level 10

It sounds like you need to clear out the variables. Since your framework doesn't reload the page, the Analytics object is never reset. I'd suggest playing around with the s.clearVars() function.