Piwik Pro with Google AMPHTML

I am having great difficulty in getting Piwik Pro working with Google AMP. In attempting to follow documentation from both amp.dev and piwik.pro I added the required amp-analytics script then this code to one AMPHTML page:

The spaces in the urls are there as it is not allowed to include links in these questions.

The tracker keeps getting hung up on the URL for “host”
Under “host” I’ve tried the following

“http s://mcharen@piwik.pro/”
Seemed to read as h t t p s://h t t p s://mscharen.piwik.pro

Seemed to read as h t t p s:////mscharen.piwik.pro

Finally, as it appeared the http s:// was being added automatically I left if off as such

This is the closest to a match but I’m getting this error message:

Error: amp-analytics request source must start with “h t t p s://” or “//” or be relative and served from either https or localhost

Invalid value h t t p s ://mscharen.piwik.pro%2F/ppms.php?action_name=Michael’s%20Book%20Corner&idsite=578bc7be-bf0b-407e-a2f7-38127607xxxx&rec=1&r=545778&url=https%3A2Fmichaelsbookcorner. com&2F&_id=e51ae163d1a1e131&apiv=1&urlref=&res=&res-768x1024&lang=en-us&gt_ms=475&cs=UTF-8&pv_id=ijFh6Nat plus a whole string of these

at ampproject. org url(h t t p s://…
at ampproject. org url(h t t p s://…
at ampproject. org url(h t t p s://…

What is the proper way to code this in order to get Piwik Pro to start transmitting tracking data to the dashboard?

Michel J. Scharen

Hi, I checked your use case and it looks like you are trying to use invalid host name in all these examples. You can check complete example of the AMP code here.
The host value that you should use is “mscharen.piwik.pro” based on errors you are showing here (it should be just a domain name of the Piwik PRO instance to which you are logging in to see your stats).
The your last try to solve it was the closest, but it looks like you left a slash at the end of domain name (the “%2F” character in error message).

Let me know if this helps you.