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.
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.
+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:
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
[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?
PS: I’ll add a new destination method run as well as hooks in the next walker.js version. This extend possibilities 10x