Skip to main content

Tracking Script

This page document Prisme Analytics tracking script configuration options and JavaScript API.

Configuration Options

User tracking is done via an ultra light script (< 1kb) tag added to pages of your website. This script is served by Prisme Analytics instances at /static/m.js. You can consult its content here.

This script is statically served (e.g. no templating) so configuration is done via data-attributes.

Prisme URL (data-prisme-url)

URL used to send event to a Prisme Analytics instance.

Example: data-prisme-url=""

Default to origin of URL used to load the script:

<!-- Events will be send to -->
<script src=""></script>

Domain (data-domain)

Domain from which events originate. This is mainly useful if you have multiple domains pointing to the same site.

Default is website host (e.g. in javascript).


Example: data-domain=""

JavaScript API

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.

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.


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


Send an empty custom event:


Send a simple custom event:

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