Skip to content

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 ​

  1. Select a name with the form namespace.action, for example pricing.viewed or trial.started.

  2. Call track with the name and the properties:

    ts
    lg.track('pricing.viewed', { plan: 'pro' });
  3. With the script tag, use the same call through lg:

    js
    lg('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.Viewed becomes pricing.viewed.
  • A name can contain a-z, 0-9, _, ., : and -. It has a maximum of 100 characters.
  • Do not use the names identify, link and profile. 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. Email and email are 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.
  • track never throws an error. To see errors, use debug mode.