I am trying to set values in some evars, props and events based on keywords present in the URL in the custom code of a direct call rule. so IF the URL contains xyz or abc, set
if (s.pageURL.indexOf("/xyz")>-1 || s.pageURL.indexOf("/abc")>-1)
any idea on how to make these conditions work?
What are you trying to understand from a user behaviour perspective for the 2 types of URLs? Can you explain in more detail your desired categorization reporting output?
Hi, your sudo code looks like you are on the right path - are you having issues, if so what are they?
I'll use document.location instead of s.* though.
i am getting data for evar and prop but not for the event. is it required to pass values into event after the evar and prop?
Looks like your event script has syntax error.
You currently have it implemented as s.event="event1", where-as it should be using s.events.
Your script should be s.events="event1".
Because the syntax is not correct.
s.events="event1"; and not s.event="event1"; 's' is missing. Kindly change.
No need to pass the value into the event.
my bad. it is s.events="event1"
so evar5 and prop5 getting triggered but event1 not getting triggered.
Can you use this instead?
s.events = s.apl(s.events, "event1", ",", 2);
If the syntax is correct, another factor which could prevent the event from being triggered completely is that your Direct Call Rule is setup to fire an "s.tl()" and your custom code is missing 'linktrackevents'.
will this have an impact on other events in the same rule?