Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.
SOLVED

Event Based listing impression rule is getting fired 2 times in React JS SPA

Avatar

Level 1

We have created one Event Based listing impression rule in our React JS based single page application. On initial page load, this event based listing impression rule is getting fired 2 times. We checked and verified that Data Layer  digitalData  object is being prepared properly and is signally properly with unique random ID change each  time and make a signal for DTM to pull request.  When user search from homepage and thus navigating to search result page, at this time this listing impression rule is getting fired only one time.This issue of twice call is happening when direct search page URL is being hit in browser address bar.   Not able to understand why this rule getting fired two times. Any help regarding this would be appreciated.

1 Accepted Solution

Avatar

Correct answer by
Level 1

Hi Jantzen,

My name is Dejan and I am one of the technical consultant investigating the aboven mentioned issue.

What I would like to correct from the original post is:

The rule only fires once, so the rule isn't the issue. We have added console logs to the rule to make sure that part is indeed firing only once.

However for example in an incognito window, the first tag that should fire. Shows twice in different debug tools. But when you look under the "network" tab the call is only made once. So we have a feeling that this is a malfunction between the debug tools such as Adobe Analytics debugger plugin and the calls actually made.

Also we looked into the fact where we would segment on visitors that only have had 1 visit, to see what the bounce rate is. Which you would expect to be 0% if it actually was making calls double. This isn't however the case.

The tag that is on top, is the one that gets fired first. So if we would change the alphabatic order of the tags, the one on top would show "twice" according to the debug tools.

We also found this article regarding the above explained issue:

https://blogs.adobe.com/digitalmarketing/analytics/under-the-hood-with-visits-and-visitors/

Our conclusion in this story currently is that all is working as intended. Do you agree?

Thanks,

Dejan

View solution in original post

7 Replies

Avatar

Level 10

Are you sure it's the event based rule getting fired twice and not the default beacon or a page load rule being fired? Have you turned on debug mode in DTM and viewed the console messages to know which rules are firing?

Avatar

Level 1

Hi Jantzen,

Yes, It is DTM rule (AA: listing impressions) which is getting fired 2 times. This rule(AA: listing impressions) is an Even Based Rule having top order, means this set on top first sequence of all rules defined. When search result page is being hit directly in browser, this rule gets fired twice. If I set any other rule (for e.g. AA: page load) at top order with first place sequence, then the this rule(AA: page load)  gets fired two times. Means, any case, the first order rule we set, is getting fired two times. I don't know what's going on? You mentioned about default beacon, but I have actually no idea about that? But I had searched to suppress default beacon, and I have already applied adding code 'return false' in Customize Page Code section in general  common DTM settings as mentioned in below links :

DTM Examples

Marketing Cloud Help | How do I suppress the default analytics beacon?

Marketing Cloud Help | How to use DTM for Single Page Apps (SPA)?

Still, the issue is same and first DTM EBR is getting fired two times.

Can you please help me out what could be the solution of my issue?

Kind Regards,

Thanks !

Avatar

Level 10

Do you have a URL and steps where I might be able to replicate this? It's hard to give more than just general advice without testing the page myself.

Avatar

Level 1

Please find the steps and URL as under-mentioned :

  • Open the new incognito mode window in Chrome browser.
  • Make sure  chrome plugin “Adobe Analytics Debugger” is on in incognito mode of chrome.
  • Hit the search page URL https://www.detelefoongids.nl/kapper/4-1/  directly into URL bar.
  • Observe the logs of “Adobe Analytics Debugger”  in console of Chrome Developer tool.
  • There are 4 server calls seems fired. Out of these 4, first 2 calls of "Adobe Analytics Server Call" are duplicate and "Adobe Analytics Server Call #1" & "Adobe Analytics Server Call #2" are the exact same rule, with same data and with same “Events : event1”.
  • Please have a look at 3 screen-shots attached for further reference.

This issue seems not only in incognito mode, but also in normal chrome window. In case if you are not able to generate this in normal chrome window, you can try with incognito mode of chrome to reproduce the issue.

Adobe_Analytics_Server_Call #2.png

All_Adobe_DTM_4_Rules.png

Adobe_Analytics_Server_Call #1.png

Avatar

Level 10

When I load your page using the method you mentioned, I'm seeing 4 different server calls. I've highlighted the difference in the first two call since you indicated they were duplicates:

    1. Browser Height (bh): 601
    2. Browser Width (bw): 960
    3. Charset (ce): UTF-8
    4. Color Depth (c): 24
    5. Cookies Enabled (k): Y
    6. Generated Request (ndh): 1
    7. Java Enabled (v): N
    8. Javascript Version (j): 1.6
    9. Resolution (s): 1920x1200
    10. pf: 1
  1. Campaign Information (1)
    1. Channel (ch): yp
  2. Ecommerce (1)
    1. Currency Code (cc): EUR
  3. Evar (11)
    1. Evar 08 (v8): D=c25
    2. Evar 09 (v9): yp_result
    3. Evar 10 (v10): D=c10
    4. Evar 11 (v11): D=c11
    5. Evar 12 (v12): D=c12
    6. Evar 32 (v32): D=c32
    7. Evar 33 (v33): D=c33
    8. Evar 36 (v36): B
    9. Evar 45 (v45): First Visit
    10. Evar 51 (v51): D=c51
    11. Evar 60 (v60): yp
  4. Page Information (2)
    1. Page Name (pageName): yp_result
    2. Page URL (g): https://www.detelefoongids.nl/kapper/4-1/
  5. Props (8)
    1. Prop 10 (c10): Kapper - Kapsalon, Barbershop, Kapsels, Haren | De Telefoongids
    2. Prop 11 (c11): /kapper/4-1/
    3. Prop 12 (c12): www.detelefoongids.nl
    4. Prop 32 (c32): 13:38
    5. Prop 33 (c33): wednesday
    6. Prop 45 (c45): First Visit
    7. Prop 51 (c51): WH-C
    8. Prop 60 (c60): https://www.detelefoongids.nl/kapper/4-1/
  6. Session (3)
    1. D: D=
    2. Timestamp (t): 27/8/2017 13:38:37 3 360
    3. fid: 49E56A723D5F0FD7-3F89D0B9CD343DBF
  7. Variables (3)
    1. Analytics Querystring Begin (AQB): 1
    2. Analytics Querystring End (AQE): 1
    3. Evar 80 (v80): D=c60
  8. version (1)
    1. JS-2.4.0-D7QN:
    1. Browser Height (bh): 601
    2. Browser Width (bw): 960
    3. Charset (ce): UTF-8
    4. Color Depth (c): 24
    5. Cookies Enabled (k): Y
    6. Generated Request (ndh): 1
    7. Java Enabled (v): N
    8. Javascript Version (j): 1.6
    9. Resolution (s): 1920x1200
    10. pf: 1
  1. Campaign Information (1)
    1. Channel (ch): yp
  2. Ecommerce (1)
    1. Currency Code (cc): EUR
  3. Evar (11)
    1. Evar 08 (v8): D=c25
    2. Evar 09 (v9): yp_result
    3. Evar 10 (v10): D=c10
    4. Evar 11 (v11): D=c11
    5. Evar 12 (v12): D=c12
    6. Evar 32 (v32): D=c32
    7. Evar 33 (v33): D=c33
    8. Evar 36 (v36): B
    9. Evar 45 (v45): First Visit
    10. Evar 51 (v51): D=c51
    11. Evar 60 (v60): yp
  4. Page Information (3)
    1. Page Name (pageName): yp_result
    2. Page URL (g): https://www.detelefoongids.nl/kapper/4-1/
    3. Unique Id (pccr): true
  5. Props (8)
    1. Prop 10 (c10): Kapper - Kapsalon, Barbershop, Kapsels, Haren | De Telefoongids
    2. Prop 11 (c11): /kapper/4-1/
    3. Prop 12 (c12): www.detelefoongids.nl
    4. Prop 32 (c32): 13:38
    5. Prop 33 (c33): wednesday
    6. Prop 45 (c45): First Visit
    7. Prop 51 (c51): WH-C
    8. Prop 60 (c60): https://www.detelefoongids.nl/kapper/4-1/
  6. Session (5)
    1. :
    2. D: D=
    3. Timestamp (t): 27/8/2017 13:38:37 3 360
    4. Visitor Id (vidn): 2CE5FF1E850303D7-400011896000465D
    5. fid: 49E56A723D5F0FD7-3F89D0B9CD343DBF
  7. Variables (3)
    1. Analytics Querystring Begin (AQB): 1
    2. Analytics Querystring End (AQE): 1
    3. Evar 80 (v80): D=c60
  8. version (1)
    1. JS-2.4.0-D7QN:

Do you have a rule that set's the Unique ID?

Here is a list of the rules that I show as firing on the page:

Rule NameRule TypeFired?Other Info
0AA: page loadEvent Basedyesdataelementchange(Page id change)
AA: listing impressionsEvent Basedyesdataelementchange(Page id change)
AA: search result pageEvent Basedyesdataelementchange(Page id change)

I assume one of these rules or somewhere in the Analytics tool itself, you have code setting the unique ID.

Hope this helps,

Jantzen

Avatar

Correct answer by
Level 1

Hi Jantzen,

My name is Dejan and I am one of the technical consultant investigating the aboven mentioned issue.

What I would like to correct from the original post is:

The rule only fires once, so the rule isn't the issue. We have added console logs to the rule to make sure that part is indeed firing only once.

However for example in an incognito window, the first tag that should fire. Shows twice in different debug tools. But when you look under the "network" tab the call is only made once. So we have a feeling that this is a malfunction between the debug tools such as Adobe Analytics debugger plugin and the calls actually made.

Also we looked into the fact where we would segment on visitors that only have had 1 visit, to see what the bounce rate is. Which you would expect to be 0% if it actually was making calls double. This isn't however the case.

The tag that is on top, is the one that gets fired first. So if we would change the alphabatic order of the tags, the one on top would show "twice" according to the debug tools.

We also found this article regarding the above explained issue:

https://blogs.adobe.com/digitalmarketing/analytics/under-the-hood-with-visits-and-visitors/

Our conclusion in this story currently is that all is working as intended. Do you agree?

Thanks,

Dejan

Avatar

Level 10

Hi Dejan,

When I look at the page using an incognito browser and the steps provided, I'm seeing two requests in the network tab for that call. The first is a 302 redirect which is used to set the s_vi cookie. The second is the 200 which is the actual beacon being sent to Analytics. This is expected behavior and shouldn't be viewed as a duplicate beacon.

If I understand your test correctly, you are correct. Having a bounce rate of grater than 0% proves that there is not a duplicate beacon on that page. If there were a duplicate beacon, it would be near impossible to have a grater than 0% bounce rate because every visitor would have at least two beacons.

Hopefully, this answers your question. Please let me know if you still have concerns.

Thanks,
Jantzen