Skip to content

Instantly share code, notes, and snippets.

@tiefenb
Created January 30, 2016 12:46
Show Gist options
  • Save tiefenb/50041bb1f99762587e0b to your computer and use it in GitHub Desktop.
Save tiefenb/50041bb1f99762587e0b to your computer and use it in GitHub Desktop.
// change your piwik server host
// change YOUR_SITE_ID with your site id
<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>
@insekticid
Copy link

thank you

@fboes
Copy link

fboes commented Nov 29, 2016

I'd like to propose a improvement:

// 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&amp;rec=1&amp;action_name=TITLE&amp;urlref=DOCUMENT_REFERRER&amp;url=CANONICAL_URL&amp;rand=RANDOM"></amp-pixel>

…by quoting & as &amp;. Otherwise: Good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment