I found this in gitgub: https://gist.github.com/tiefenb/50041bb1f99762587e0b
I could put this snippet in the amp templates of my theme.
<amp-pixel src="https://piwik.example.org/piwik.php?idsite=YOUR_SITE_ID&rec=1&action_name=TITLE&urlref=DOCUMENT_REFERRER&url=CANONICAL_URL&rand=RANDOM"></amp-pixel>
Is there an easy way to get the current Piwik siteID? Something like this in my templates? Does this exists?
<?php getPiwikSiteID(); ?>
Hi,
thank you. But I think you are wrong about piwik as an offical analytics tool. It is the other way round: Piwik has to support AMP to get listed on that page. So if you would build AMP functionality into this plugin my guess would be that piwik gets listed.
I only manage the WordPress plugin to integrate Piwik. So adding or registering Piwik as official analytics tool should be done by the Piwik team – I don’t think it’s intended to mark a tool as “official” just because a WordPress plugin offers support. 😉
You can join the Piwik team’s discussion here: https://github.com/piwik/piwik/issues/10539