-
Notifications
You must be signed in to change notification settings - Fork 351
Replace piwik with matomo analytic templates #7693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace piwik with matomo analytic templates #7693
Conversation
@fnagel thx for the pull request can you add a short line to the Something similar to:
|
Based on Matomo version 5.1.2. See sulu#7692
5b44b6f
to
138da56
Compare
@alexander-schranz Changed the |
@fnagel awesome. Thank you! |
_paq.push(['trackPageView']); | ||
_paq.push(['enableLinkTracking']); | ||
(function() { | ||
var u="{{ analytics.content.url|trim('/') }}"; | ||
_paq.push(['setTrackerUrl', u+'/piwik.php']); | ||
_paq.push(['setTrackerUrl', u+'matomo.php']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The forward slash has been removed here, which is causing invalid URLs to be constructed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I copied the latest code from the Matomo docs without checking what the u variable will contain. Thanks!
@@ -1 +1 @@ | |||
<noscript><p><img src="{{ analytics.content.url }}/piwik.php?idsite={{ analytics.content.siteId }}" style="border:0;" alt="" /></p></noscript> | |||
<noscript><p><img referrerpolicy="no-referrer-when-downgrade" src="{{ analytics.content.url }}/matomo.php?idsite={{ analytics.content.siteId }}&rec=1" style="border:0;" alt="" /></p></noscript> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs the |trim('/')
filter to ensure there is not a duplicate forward slash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. This seems to be an issue even before my changes.
What's in this PR?
Updated the Matomo templates.
Why?
Because the current ones are outdated.