Expand my Community achievements bar.

SOLVED

Adobe Launch - Custom code firing pageview call not event call

Avatar

Level 2

Hi Team,

We created one custom javascript rule where we firing custom evar , props and events using custom code and firing custom event but becone is firing pageview call not event call.

 

please help us how to fire custom code events by event call not by pageview.

 

Thanks & Regards,

Madhusudan Sura | madhusudan.sura@mindtree.com

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi @Madhusudan_S ,

 

I would be cautious with the approach in your custom code. There will be a race condition around firing beacon and clearing the variables. Not sure how Launch handles this behind the sences, but Adobe's documentation suggests registering a clearVars() callback using registerPostTrackCallback(), reference .

This way you can ensure that the variables are only cleared after sending the beacon.

As a second note, once you've registered a callback, it is set until you make a new instance of the tracking object. That is, if you've defined "s" as the global tracking, App Measurement object, then registered the callback, all track calls will clear variables. If you don't want to have all calls clear the variables, you'll need to combine this method with something else that will either re-define the s object afterwards and/or use s_gi() to set a dummy object for this purpose, reference.

 

Oh, third thing, you probably want to pass the first parameter in tl() as true, to see if the delay is causing you an issue, reference.

View solution in original post

8 Replies

Avatar

Level 7

@Madhusudan_S  Are you saying that s.tl() call is not firing or the custom events are not being fired in a pageview or a custom link call ? Which event call  you are referring to here ? Two beacon calls can be fired :-
A) Page View  [s.t()]

B) Custom Link Tracking Call [s.tl()]

 

Which event call you are referring to here ?

Avatar

Level 2
@amgup : Yes, s.tl() call is not firing for custom clickable events . whenever i do clickable event its firing pageview call s.t() NOT Custom Link Tracking s.tl()

Avatar

Level 7
Can you share a code snippet from where you are firing the call ?

Avatar

Level 2

$('a[href="xxxxx.html"]').click(function(){ s.linkTrackVars="eVar53,prop11,events"; s.linkTrackEvents="event31"; s.events="event37"; s.eVar53= "xxxxxx - Sign In Clicked"; s.prop11= "xxxx - Sign In Clicked"; s.tl(this,'o', "xxxxxx - Sign In Clicked"); s.clearVars();

Avatar

Level 2

$('input[name="xxxxxxxxxxxxxx"]').click(function(){ s.linkTrackVars="eVar53,prop11,events"; s.linkTrackEvents="event37"; s.events="event37"; s.eVar53=s.prop11= "xxxxxxxx - Authorizaion for text message: User Interacted"; s.tl(this,'o',s.evar53); s.clearVars(); });

Avatar

Employee Advisor

Can you share the custom code here?

Avatar

Correct answer by
Level 6

Hi @Madhusudan_S ,

 

I would be cautious with the approach in your custom code. There will be a race condition around firing beacon and clearing the variables. Not sure how Launch handles this behind the sences, but Adobe's documentation suggests registering a clearVars() callback using registerPostTrackCallback(), reference .

This way you can ensure that the variables are only cleared after sending the beacon.

As a second note, once you've registered a callback, it is set until you make a new instance of the tracking object. That is, if you've defined "s" as the global tracking, App Measurement object, then registered the callback, all track calls will clear variables. If you don't want to have all calls clear the variables, you'll need to combine this method with something else that will either re-define the s object afterwards and/or use s_gi() to set a dummy object for this purpose, reference.

 

Oh, third thing, you probably want to pass the first parameter in tl() as true, to see if the delay is causing you an issue, reference.

Avatar

Level 2

Hello!

 

How is your Launch rule being fired? As I see it is not the rule itself that fires the beacon, but rather the function you're adding to the HTML objects via jquery, so maybe there's a context issue there. Do you have any errors in your console when you click on the related elements?

 

I would recommend instead of using the custom code in the function to fire the beacon programatically to call _satellite.track() and manage things inside another rule using Launch interface and AA extension.

 

Good luck.