aymen hadhraoui aymen hadhraoui - 2 months ago 16
Javascript Question

Omniture Tracking equal character "=" escape

When i use equal character "=" in s.events parameter it not appear in the omniture click event.

example: s.events = "event54=any_string";

Reagrds,

Answer

Your comment on @MisterPhilips's answer:

Hello, No, I'm not trying to do event serialization, I'm trying to pass in the event click for exampel s.events = "event1=<>". I can do that with a load event (when calling s.tl()) but not with click event (when calling s.th(this, 'o', title))

A "load" event is s.t(). A "click" event is s.tl(). There is no (official) s.th() call for Adobe Analytics (AA).

The reason why it "works" for a load event is because the AA code doesn't require you to "register" events on an s.t() call. However, events and variables must be "registered" for s.tl() calls, or they won't show up in the request.

You "register" events with linkTrackVars and linkTrackEvents, like this (example):

s.linkTrackEvents="event54";
s.linkTrackVars="events";
s.events="event54=<something>";
// example click call
s.tl(true,'o','some click');

Having said that, @MisterPhilip is right about what values you can set to an event. The only type of events AA has are numeric/counter/currency - all a number type. That is because events are meant to be used as metrics in reports, not dimensions.

So, while you can do the above code, and it will be sent in the AA request, AA server is going to look at that and toss it out because it's an invalid value.

If you want to set something to an arbitrary (string) value, you need to make use of the dimension type variables, most commonly props or eVars, but there are others like hier or list, as well.

Comments