Track User Event

This method is used to send data about the users behaviour on-site to the Intilery system. The event data is mapped to the entities and properties you setup in the Intilery application. Entity and property names are case sensitive, spaces in both are allowed. You can view the entities and entity properties in "Models" section of the Intilery application.

Syntax:

__itq.push(["_trackUserEvent", <eventAction>, <keyValueArray>, [<eventName>], [<eventCategory>], [<callbackFunction>], [<errorCallback>] ]);
  • eventAction (required)
    • The name of the behavioural event, e.g. 'sign-in', 'register', 'add to basket'
  • keyValueArray (required)
    • An object of 0 or more properties in the form of {"property":"value"}
  • eventName (optional)
    • A string value representing the name of the event to track, note this is different from the eventAction. E.g. you may have more than one way a user can login; a usual login form and a social login, both eventActions would be sign-in whilst the eventNames would be main and social respectively.
  • eventCategory (optional)
    • A string value representing the eventCategory, for example; `ecommerce`
  • callbackFunction (optional)
    • A function which will be called after the network request to send the event to Intilery has completed. The callback function can be used even if eventName and/or eventCategory is omitted, as the system will pick up the argument as a function, not a string.
  • errorCallback (optional)
    • A function which will be called only if there is some network error when sending the event to Intilery. If a callback function is provided, but no error callback is, then the callback function will also be called in event of an error.

Example (Single Event):

_itq.push(["_trackUserEvent", "sign in",
	{"Customer":
		{"Email":"String Value"}
	},
	"Sign In"
]);

Example (Multiple Events)

To send multiple events, pass multiple arrays into the push method
_itq.push(
	["_trackUserEvent", "sign in",
	{"Customer":
		{"Email":"String Value"}
	},
	"Sign In"],
	["_trackUserEvent", "sign out",
	{"Customer":
		{"Email":"String Value"}
	},
	"Sign out"]
);

Important: All events sent to the Intilery system will be recorded against an anonymous visitor, the events for each session are recorded against a single unique visitor ID with different sessions. In your user journey you will give your users the ability to authenticate themselves, you will do this via either a  sign inregister, or other mechanism. Once the user successfully authenticates them against your system/site you should send the appropriate event to Intilery to associate the current session with the known customer.

You only need to do this once per lifetime of the customer, all future sessions will belong to the customer automatically.

To authenticate the anonymous visitor as a customer, send a pre-defined event (sign in, register, etc.) including the customers email address (email is the primary key of the user), e.g.

NOTE: Customers are also authenticated if they click on an email sent to them from Intilery, as long as the link in the email lands the customer on your website, this is an automatic feature.

Still need help? Contact Us Contact Us