You can easily track your pages with Piwik using <amp-pixel>
tag in this way:
// change your piwik server host
// change YOUR_SITE_ID with your site id
// All other variables will be replaced by AMP, see https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md
<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>