Skip to main content

Tracking Script

Prisme expose all of it's public API functions under window.prisme. If you're using tracking script provided

Page Views

Page view events are automatically send on page load and when a new entry is pushed to window.history. This should cover static websites and SPA (Single Page Application) using client router.

Custom Events

Custom events can be send via the window.prisme.trigger function. This function takes two argument:

  • a string: the name of the event
  • an object: key-value pairs or attributes attached to the event.
note

You don't need to include the date, domain or the path of the page in the object as it automatically added by Prisme server.

tip

It is recommended to avoid nested JSON objects as it may impact performance at query time.

Examples

Send an empty custom event:

window.prisme.trigger('sign_up')

Send a simple custom event:

window.prisme.trigger('checkout', {
plan: 'growth',
frequency: 'monthly'
})