I’m going to develop a full Piwik PRO implementation as a walker.js destination. People using walker.js should easily send data to Piwik Pro via the JavaScript Tracking Client.
If you have any recommendations about the best possible integration or want to share thoughts on how to pimp a setup, feel free to contribute here
Hi. Really nice to see that you plan to work on a Piwik PRO destination
The integration itself can work in a similar way to GA. I see in the docs that there’s even a destination for GTM. What would be the point to set up something like that? Or is it just server-side GTM? Piwik PRO Tag Manager is really similar to GTM (client-side), that’s the reason why I’m asking.
When it comes to the plan it looks fine. I’d wait a bit with e-commerce, since we’re going to release new features and events in April/May.
Tag manager is recommended because it installs by default also our consent manager and makes further changes in configuration easier.
By reading the docs, I can see that walker.js is more a replacement for a client-side tag manager. You simply control all the events and triggering via HTML markup. If that’s right, you can simply use _paq.push or our javascript API directly. For _paq.push this should be a nice starting point: Installation — Piwik PRO Analytics Suite 16.37 documentation
As for installation, I think it’s a good idea to install Piwik PRO Analytics via Piwik PRO Tag Manager by default (with an option to not use it at all). This gives the users full value (basic Analytics code and Consent Manager installed by default). When you use the Tag Manager, you can use paq.push to manually send events or change the tracking configuration as you go.
When it comes to e-commerce, we have new API contracts, but we need to wait a bit more to be able to share them publicly.
After reading a little bit, I’d prefer to create a separate destination for the Piwik Tag Manager. Otherwise there are too many overlaps and duplicate setting to control linkTracking, pageview or duplicate events.
I focus on the JavaScript Tracking client first. It’s also the same logic for Google with their Tag Manager and a separate GA4 destination.
+1 for a separate destination with the regular “Analytics only” JS code.
This will be most useful in a walker.js setup with multiple destinations.
Adding an additional destination for the full code including the Tag Manager (and Consent) can then feed the dataLayer with events just like the GTM one.
A mapping for consent would be great here as well but this might need some more thought than just writing down whatever comes to my mind… now that I think about all the stuff a Piwik PRO destination could be used for .
That’s my plan for the first version of the destination right now:
General config
{
appId: 'XXX-XXX-XXX-XXX-XXX', // Id of the site
url: 'https://your_account_name.piwik.pro/', // Same address as the Piwik
// linkTracking: false, // Disable download and outlink tracking
// pageview: false, // Disable default pageview events
// domains?: Array<string>; // List of internal domains (uses setDomains)
// userId?: string; // key from the event like user.id that uses setUserId
}
And the custom config for each event will look like this
{
name?: string; // key from event like data.title for trackCustom
value?: string; // key from event like globals.cart_items for trackCustom
dimension: {
[id: number]: string; // keys for additional dimension mapping
}
goal?: string | number; // value of the goal id that triggers a trackGoal push
}
this would only send custom events in every case and no regular pageviews without a custom mapping, if I understand your plan correctly? If so, the result will not be able to feed all reports with data. Also a mapping with standard categories for outbound links or downloads would be helpful…?
I’d try to call the best method like trackPageView (always for the page view event), trackEvent (default), or trackGoal (if goal is set), and in later versions also trackSiteSearch (for search is true) as well as the new e-commerce setup.
This should capture the most setups, wouldn’t it?
Best regards
PS: I’ll add a new destination method run as well as hooks in the next walker.js version. This extend possibilities 10x
It’s handled by the tag manager, so if you’re not installing it, virtual page views should be added via mentioned trackPageView with proper URL and title.