Expand my Community achievements bar.

SOLVED

Launch Rule Not Consistently Firing on Link Click

Avatar

Level 4

Hello,

We have a a simple configured in Launch. The "trigger" event is merely Core -> Click with a simple CSS selector. There is no condition and the the "Action" portion is custom JS that fires a target mbox.

 

However, we are having issues with this rule firing consistently. It appears to be a timing issue. When the rule fails to fire, I notice a Warning being logged to the console: "Loading failed for the <script> with source “https://assets.adobedtm.com/xxxx/xxxx-source.min.js”.  This message does not appear when the Action fires correctly (with the "firing correctly" being verified using the Adobe debugger extension.) If I manually navigate to the script that the browser warns had failed to load, it loads just fine and I can confirm that it is the custom code I wrote for the "Action" in Launch. Additionally, the source (in Firefox's Dev Tools console) of the aforementioned warning is the initial/source page (the one with the link containing the rule trigger) not the destination page. However, the Warning itself is logged while on the destination page, not the source.

 

I am wondering if this is a common/known issues with Launch and how we might resolve. I realize there is an option to delay navigation in the "Click" event within Launch, but this is something we would like to avoid.

 

Any tips are much appreciated.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Per what you described it might be linked to race issue. based on the documentation is seems you can specify an onSuccess callaback : How Do I Use the adobe.target.trackEvent() Function? | Adobe Target

 

successFunctionNoA callback function used to signal that event has been reported.

 

As the function only reports an event to target could it be as simple for your to preventDefault for the navigation link and once the success function is called navigate to your destination ? 

View solution in original post

5 Replies

Avatar

Community Advisor

Could you provide us an url where we can test and see what is happening ? 

If you cannot do that can you provide the adobe launch logs. 

 

Is it the rule in itself that fails to fire or the action script that fails to run ?

Avatar

Level 4

Thanks for the response. Unfortunately, I cannot provide a URL or logs. Sorry, I realize this will make troubleshooting difficult.

 

How would I distinguish between the rule firing and action script? Currently, the only way I can determine whether or not it is operating correctly is using the Debugger extension and seeing if the mbox call (the action script) comes through. I assume the issue is caused by the action script failing to load (per the Dev Tools console), but why would it fail to load?

Thanks.

Avatar

Community Advisor

A rule is successfully if you see in the developer console log (providing you enabled launch debug mode):

Rule "MY RULE NAME" fired.

 

Now if that is displayed the rule fired successfully, and if error is displayed then it means something in your action script fails at some point.

 

Do you have more details on the extension version (I guess adobe target per your comment) and what you put in the action so we can try to support you

Avatar

Level 4

Thanks for the information. Yes, it appears that the rule is firing correctly.

 

The only extension used is Core (v1.8.3). The action type is a Custom Code that, in part, calls "adobe.target.trackEvent" to fire a custom mbox. It works consistently if I manually disable the link navigation event (that triggers the rule) and it works part of the time without any navigation delay inserted.

 

Thanks again.

Avatar

Correct answer by
Community Advisor

Per what you described it might be linked to race issue. based on the documentation is seems you can specify an onSuccess callaback : How Do I Use the adobe.target.trackEvent() Function? | Adobe Target

 

successFunctionNoA callback function used to signal that event has been reported.

 

As the function only reports an event to target could it be as simple for your to preventDefault for the navigation link and once the success function is called navigate to your destination ?