Expand my Community achievements bar.

SOLVED

Custom Event created via Core Extenstion Does not gets Triggered Correctly

Avatar

Level 2

I am facing this issue of my purchase event getting triggered at incorrectly pageURLs 

Example 
when the user comes to my cart my url is : www.abc.com/checkout?..&step=1

when the user fill the payment details my url is www.abc.com/checkout?..&step=2
when the user completes the checkout my url is  www.abc.com/checkout?..&step=4

I am seeing majority of my purchase calls getting trigerred at  www.abc.com/checkout?..&step=2 . I have checked with the backend team the custome event dispacthing looks solid. are there any precautions that should be taken while configuring the custom event? - below is the attached screenshot. I am including the eventObject.name 

@Jennifer_Dungan @yuhuisg 

Screenshot 2024-06-11 135323.png

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @omkarbh 

is there any chance your devs can push the URL into the event, and you can pick it up from there instead of using the URL?

Cheers from Switzerland!


View solution in original post

7 Replies

Avatar

Community Advisor

Hi @omkarbh 

what's happened to step3?

 

Just kidding, but maybe this case would be the perfect situation to have a data layer to push event data in and react to that instead of setting up custom DOM events that may be cancelled while bubbling up.

 

There are a couple of extensions available in the Adobe Launch world e.g., Adobe's Client Data Layer (window.adobeDataLayer), there is a Google Data Layer (window.dataLayer) and even also some 3rd party extensions. All of them are fairly easy to use, but take a little bit of extra work for your frontend guys to set up. But then you have a clean interface 

 

(Or you just ask your frontend guy to trigger your "checkout.purchase" event as a direct call and listen to it in your rule. This is the rather classic way and in my opionion not 2024 anymore.

 

_satellite.track("checkout.purchase", {
  // your additional event payload goes here
})

)

 

Hope that helps a little 

Cheers from Switzerland!


Avatar

Level 2

DataLayer sounds like a very good idea. 

When we say direct call is it tlike 

_satellite.track("checkout.purchase", {
  // your additional event payload goes here
})

putting the above snippet in the code and passing the indentifer checkout.purchase in launch while setting up the direct call rule via core extension? 

Avatar

Community Advisor and Adobe Champion

Is Step 4 the success page? But maybe the actual success, before sending the person to that page is on the previous step? If this is an SPA, then this might be related to a timing delay...

 

So for example:

  • Cart
  • Checkout Page (Please enter your details)
  • User Enters Details and Submits
  • Payment is processed
  • Payment Complete occurs (this is your actual success event)
  • Payment Success Page

 

Technically the "completion" is between pages... if an SPA, this might trigger before the URL is updated to the success page?

Avatar

Level 2

Yes - the step 04 is a sucess page andyes our application is on SPA . Is there a way we came over come the timing delay in launch? I am seeing purchase event triggering at 2 & 3 step. 3 can be understandle but purchase event triggering on step2 is very suprising? 

Can the checkboxs ticked below can cause it? What suitable conditons can be given to ensure the success event will trigger correctly on the success page

Avatar

Community Advisor and Adobe Champion

Without seeing the actual site behaviour, I can't tell you what might and might not be calling the event... if you haven't already, turn on Satellite Debugging in your console so that you can see when your custom event rules are being fired... also try backing up after a success, maybe the event is re-triggering for users when they use their browser history to navigate?

 

// Turn on satellite debugging
_satellite.setDebug(true);

// Turn off satellite debugging
_satellite.setDebug(false);

 

 

As for delaying Launch, I've used some custom code solutions to achieve this.. but it's not the prettiest lol.

 

Basically, I've built in a setTimeout in the custom code of my Set Variables action to force that code to take longer to execute before the beacon gets sent....  but in this case, the URL would still have the value that was picked up before the delay... You may have to try using a setTimeout in a custom code block before Set Variables, to delay the start of setting the variables (make sure you are using sequential execution, and it says "Wait, Then" between the rules...  

Avatar

Correct answer by
Community Advisor

Hi @omkarbh 

is there any chance your devs can push the URL into the event, and you can pick it up from there instead of using the URL?

Cheers from Switzerland!


Avatar

Level 2

Hey! I like this work around - I will definetly try using this one.

I am thinking of using it this way 

have a key pair value in event that contains the trimed part of the URL checkoutStep4. In launch conditions block I will give a condition is 

event.detail.URL = 'CheckoutStep4'

THEN

ACTION
Set Variables