PiwikPro integration with Hotwire Turbo


I’m trying to get PiwikPro playing nice with Hotwire Turbo ( https://turbo.hotwired.dev/ ) without success.

Basically, what Turbo does is provide your application with some SPA functionality. In its most basic form, it will only replace HTML content inside your page’s tags, so it won’t reload the full page. It does this by intercepting the click events and performing an xhr request to the server.

The issue I’m currently experiencing is that it seems that Piwik.Pro also intercepts click events, but instead of bubbling back up, it performs a regular get-request to the server.

Is there a way to make Piwik.Pro play nice with Turbo, keeping our former functionality? Or do I have to implement Piwik.Pro in a totally different way?

Do you have maybe any example site that is using this solution? I did some testing on https://turbo.hotwired.dev/ and the tracking works (default SPA tracking option from site’s settings). The only issue is that the page view requests are sometimes duplicated (not sure why).

Hi @kuba ,

The tracker is implemented in our SAAS application. I could perhaps provide you with some credentials to log in if you would like that.

In the meantime, I’ll try and set up a simple example to simulate the issue.

Sure, both should work. :slight_smile: