# Piwik Pro with Google AMPHTML

**URL:** https://community.piwik.pro/t/piwik-pro-with-google-amphtml/501
**Category:** API & integrations
**Created:** [March 8, 2022, 11:57pm UTC](https://community.piwik.pro/t/piwik-pro-with-google-amphtml/501 "2022-03-08T23:57:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mscharen](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@mscharen](https://community.piwik.pro/u/mscharen)
#### Post date: [March 8, 2022, 11:57pm UTC](https://community.piwik.pro/t/piwik-pro-with-google-amphtml/501/1 "2022-03-08T23:57:04Z")

</div>

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

“[//mscharen@piwik.pro/](https://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  
“mscharen@piwik.pro”

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

---

<div class="post-metadata">

### Author: ![Roman\_Sek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/roman_sek/32/282_2.png) [@Roman\_Sek](https://community.piwik.pro/u/Roman_Sek)
#### Post date: [March 14, 2022, 7:44am UTC](https://community.piwik.pro/t/piwik-pro-with-google-amphtml/501/2 "2022-03-14T07:44:38Z")

</div>

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](https://developers.piwik.pro/en/latest/data_collection/other_integrations/AMP_integration.html#complete-page-example).  
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).

> [@mscharen](#):
>
> h t t p s ://mscharen.piwik.pro%2F/ppms.php

Let me know if this helps you.
