Expand my Community achievements bar.

Join us for the next Community Q&A Coffee Break on Tuesday April 23, 2024 with Eric Matisoff, Principal Evangelist, Analytics & Data Science, who will join us to discuss all the big news and announcements from Summit 2024!
SOLVED

Not able to register an event on click of anchor tag

Avatar

Level 1

Hi,

Thanks for the reply and here is my code snippet that i am using : 


$(document).ready(function () {
$(".PlayCase").click(function() {
s.linkTrackEvents="event21";
s.linkTrackVars="events";
s.events="event21";
s.tl(true,'o','video click');
});
});


My html is like this for html element with playcase class:

<a class="PlayCase" onclick="SetVideo(this, 'playlist?list=PLpnDsRVtqUQoxQMn13Z2HjvpJ_-sezKWS');" href="#"><input id="VideoTitleHidden" type="hidden" value="abc"> <input id="VideoSubTitleHidden" type="hidden" value="hk"> <img src="/hk.jpg" alt="hk" width="315" height="178"></a>

But still it is not working and i inspected through httpfox and fiddler as well but event21 is not getting registered but on the click of the anchor tag the script is getting executed and we have checked it through debugger as well. 
Do we need to add prop as well or should it work without that as well.

Let me know where we are going wrong.

Thanks in advance,
Akshay

1 Accepted Solution

Avatar

Correct answer by
Level 6

right now it's beyond me to debug your javascript code unfortunately. I do see lots of errors in the console of developer tools in chrome when I load the pages. Maybe something is getting blocked.

I think you need to reach out to Adobe through either customer care or your adobe consultant to get some help debugging your code.

It's either something major or it's a missing ; or . or ' someplace that neither you or I are seeing.

good luck

View solution in original post

8 Replies

Avatar

Level 6

Missing the connection between the SetVideo routine and the function that calls s.tl it's hard to tell but have you tried changing true to this in the s.tl call since the definition says to use this if you are tracking and object that has an HREF. and you have an HREF here see if that works.

Avatar

Level 1

Hi,

I have tried both 'true' and 'this' with s.tl but still what is happening like event is getting recorded in site catlyst tool (report suite) but not correct numbers. eg sometime 1 or 2 /day and sometimes 0 and maximum has been 9. The number should have been lot more.

We have also tried adding eVar and prop but still it doesn't work.

SetVideo won't have anything to do with it as for sitecatalyst we have written the script in head of the page.

Let me know if you need any more inputs

Avatar

Level 6

If you use developer tools in chrome (and get the observepoint plug-in from observepoint.com) or firebug with omnibug and you can see if you are actually sending out an s.tl call even in just developer tools in the network tab you can see your metrics server calls (whatever you trackingServer is set to) there should be 2 calls. The s.t for the page load and the s.tl for the video click.

another thing if those are filled out ok you can do a processing rule (assuming you have access to processing rules) and see if a custom link named 'video click' comes by and set some event to 1 when that happens. (there are lots of new events you can use). or check if event21 is set...

and btw in your definition of event21 is it set as a counter? (it should be a counter) and is it set to 'always record this event'

Avatar

Level 1

Hi,

The url where you can find it implemented is as mentioned below:

http://www.lightsbytena.se/trana-underlivet/knip-med-karin-bjorkegren-jo...
http://www.lightsbytena.dk/traen-din-baekkenbund/knib-med-karin-bjorkegr...

In first one 'this' is being used as parameter to s.tl() and in second one 'true' is being used.

One more thing that has come up of which we are not certain is that it seems like only events from Internet explorer are getting registered and not from any other browser. We are not sure about this.

It is set as counter and always record this event 

Avatar

Level 6

I think your google analytics call is causing the s.tl to fail. I tracked the code and the s.tl call happens it just doesn't send the network request back to your collection server. But the google analytics that happens at the same time does work. If google is first try swapping the adobe and google calls so adobe is first and see if that fixes it.

There are a lot of errors thrown in the console when I click on any of the videos. some of those could kill the adobe code.

I'd get your adobe consultant to work with you to make sure it's all setup correctly because there is some small error that is killing the s.tl call

Avatar

Level 1

Hi , I have changed the order of google analytics and site catalyst scripts.Lets see how it works.

Avatar

Level 1

Hi,

It still doesn't work even after changing the order.

Avatar

Correct answer by
Level 6

right now it's beyond me to debug your javascript code unfortunately. I do see lots of errors in the console of developer tools in chrome when I load the pages. Maybe something is getting blocked.

I think you need to reach out to Adobe through either customer care or your adobe consultant to get some help debugging your code.

It's either something major or it's a missing ; or . or ' someplace that neither you or I are seeing.

good luck