Piwik PRO
Piwik PRO is a European, privacy-focused web analytics and marketing platform that helps businesses track website traffic and user behavior.
Installation
- TypeScript
- Script
- Code
Install the destination via npm
npm i @elbwalker/destination-web-piwikpro
import { elb } from '@elbwalker/walker.js';
import destinationPiwikPro from '@elbwalker/destination-web-piwikpro';
elb('walker destination', destinationPiwikPro, config);
Load the destination via dynamic import
<script>
// Upload the dist/index.mjs on your own server
const destination = (
await import(
'https://cdn.jsdelivr.net/npm/@elbwalker/destination-web-piwikpro/dist/index.mjs'
)
).default;
elb('walker destination', destination, config);
</script>
Copy the code from the index.browser.js file
(function () {
'use strict';
var Destination = (() => {})(); // This is the copied code
elb('walker destination', Destination.default, config);
})();
Configuration
Configure your PiwikPro destination with your App ID and URL.
Example
const config = {
custom: {
appId: 'XXX-XXX-XXX-XXX-XXX', // Id of the site
// linkTracking: false, // Disable download and outlink tracking
url: 'https://your_account_name.piwik.pro/', // Same address as the login
},
mapping: {
order: {
complete: {
name: 'trackEcommerceOrder',
custom: {
// CustomEvent
goalId: 'xxx-xxx-...', // Count the event as a goal
goalValue: 'data.total', // Property to be used as goal value
},
data: [
'data.id',
'data.total',
{
fn: (event) => {
const total = Number(event.data?.total ?? 0);
const taxes = Number(event.data?.taxes ?? 0);
const shipping = Number(event.data?.shipping ?? 0);
return total - taxes - shipping;
},
},
],
},
},
},
};
Custom
Property | Type | Description |
---|---|---|
appId* | string | ID of the Piwik PRO site |
url* | string | URL of your Piwik PRO account |
linkTracking | boolean | Enables/Disables download and outlink tracking |
pageview | boolean | Enables/Disables default pageview events |
Properties with a *
are required.
CustomEvent
For custom event mapping (mapping.entity.action.custom
):
Property | Type | Description |
---|---|---|
goalId | string | ID to count the event as a goal |
goalValue | string | Property to be used as the goal value |
name | string | Custom name for the event |
value | string | Property to be used for the event value |
info
If you need professional support with your walkerOS implementation, check out our services.