Install Seline

Put the HTML script below in the <head> section of your website. Make sure to have it on every page. And don't remove async property, so your website loads without having to wait for the script.

<script src="https://cdn.seline.so/seline.js" async></script>
Click anywhere to copy

Then go to your website and click around a few pages. These views will count as your first events and you'll see them right on the dashboard. That's it.

All page views are tracked automatically by default.

Options

Our script can be further customized using the following options, which can be applied via data attributes.

token

IMPORTANT

Token is required when tracking subdomains or multiple domains. You can find your project token in the project settings.

<script data-token="PROJECT_TOKEN" src="https://cdn.seline.so/seline.js" async></script>
Click anywhere to copy

autoPageView

By default, we track all page views automatically. But if you want manual tracking with seline.page(), you can set autoPageView to false.

<script data-auto-page-view="false" src="https://cdn.seline.so/seline.js" async></script>
Click anywhere to copy

skipPatterns

Specify an array of pages or patterns you don't want to be tracked. These can be exact paths, such as /about or /how-it-works, or patterns with a wildcard *, such as /blog/* or /projects/*/visitors/*.

<script data-skip-patterns="['/about', '/blog/*']" src="https://cdn.seline.so/seline.js" async></script>
Click anywhere to copy

maskPatterns

Specify an array of pages or patterns you want to mask. This works similarly to skipPatterns, but instead of skipping routes, it masks them and tracks the masked value. Ideal if you want to mask routes with private IDs, like /customer/*/order/*.

<script data-mask-patterns="['/customer/*/order/*']" src="https://cdn.seline.so/seline.js" async></script>
Click anywhere to copy

Methods

page

If you set autoPageView to false, you can manually track current page views.

seline.page();
Click anywhere to copy

track

Track custom events using seline.track(). You can pass event name and custom properties.

seline.track('Order completed', {
delivery: 'DHL',
total: 99.99
});
Click anywhere to copy

enableAutoPageView

If you loaded the script with autoPageView set to false you can enable it with seline.enableAutoPageView().

seline.enableAutoPageView();
Click anywhere to copy

setUser

Populates visitors with custom data and creates a profile. Great for tracking your authorized users. Read more about it at our profiles page.

seline.setUser({
userId: "unique-user-id", // userId is a required field
plan: "enterprise",
credits: 140,
});
Click anywhere to copy