Track events
Send your own events when a visitor does an important action, for example when the visitor opens the price page or starts a trial.
Procedure
Select a name with the form
namespace.action, for examplepricing.viewedortrial.started.Call
trackwith the name and the properties:tslg.track('pricing.viewed', { plan: 'pro' });With the script tag, use the same call through
lg:jslg('track', 'pricing.viewed', { plan: 'pro' });
Result
The client adds the page, the UTM values of the session and the time. It sends the event in the next batch.
Rules for names and properties
- The client removes spaces at the start and the end of a name, and changes the name to lowercase.
Pricing.Viewedbecomespricing.viewed. - A name can contain
a-z,0-9,_,.,:and-. It has a maximum of 100 characters. - Do not use the names
identify,linkandprofile. The client sends them itself. - Do not use names that start with
system.. QuickPipe rejects all these names. - The client keeps the property keys as you send them.
Emailandemailare two different keys. - The properties are a JSON object of 32 KB or less, with a maximum depth of 5 and a maximum of 200 keys.
tracknever throws an error. To see errors, use debug mode.