Search K
Appearance
Appearance
The Palzin Track Web SDK tracker exposes a function that you can call on your website if you want more control over your tracking. By default everything is automatically collected, but you can disable this using data-auto-track="false" and sending the data yourself.
pt.track([payload]);
pt.track(event_name, [event_data]);pt.track([payload]);
pt.track(event_name, [event_data]);Tracks a page view.
pt.track();pt.track();By default the tracker automatically collects the following properties:
hostname: Hostname of serverlanguage: Browser languagereferrer: Page referrerscreen: Screen dimensions (eg. 1920x1080)title: Page titleurl: Page urlip: User IP AddressIf you wish to send your own custom payload, pass in an object to the function:
pt.track({
screen: '1920x1080',
url: '/home',
title: 'Home page'
});pt.track({
screen: '1920x1080',
url: '/home',
title: 'Home page'
});The above will only send the properties screen, url and title. If you want to include existing properties, pass in a function:
pt.track(props => ({
...props,
url: '/home',
title: 'Home page'
}));pt.track(props => ({
...props,
url: '/home',
title: 'Home page'
}));Tracks an event with a given name.
pt.track('signup-button');pt.track('signup-button');Tracks an event with dynamic data.
pt.track('signup-button',
{
name: 'newsletter',
id: 123
});pt.track('signup-button',
{
name: 'newsletter',
id: 123
});When tracking events, the default properties are included in the payload. This is equivalent to running:
pt.track(props => ({
...props,
name: 'signup-button',
data: {
name: 'newsletter',
id: 123,
},
}));pt.track(props => ({
...props,
name: 'signup-button',
data: {
name: 'newsletter',
id: 123,
},
}));Event Data can work with any JSON data. There are a few rules in place to maintain performance.