Google AMP Issue: “Custom Javascript Not Allowed”
- This topic has 7 replies, 2 voices, and was last updated 4 months, 1 week ago by .
- AuthorPosts
- October 28, 2020 at 2:23 am#4305
HopsWrites
I checked on my Publii site after having submitted a sitemap days ago. After inspecting my main URL, it said the “AMP Page is invalid” due to custom Javascript not being allowed.
I have AMP turned on in the Publii settings. I haven’t messed with anything. What’s going on? Please help as I want to make my new site discoverable and be able to use all Search Console features.
Thanks,
Jordan
October 28, 2020 at 6:14 am#4306Bob
SupportYou haven’t shared your website URL, so how can we check what’s going on?
--
Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!October 28, 2020 at 12:20 pm#4307HopsWrites
Here’s the URL:
October 28, 2020 at 1:58 pm#4308Bob
SupportThe mentioned issue is caused by the fact that most likely you put the plausible.js script into the amp files. Remove it and validate the page once again, I think it should help.
--
Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!October 28, 2020 at 2:07 pm#4309HopsWrites
Thank you for your time, Bob!
I’m not a dev, so I hope this question makes sense: If I remove my Plausible code from AMP, will it still help me track mobile traffic?
Also, where should I inject the Plausible code so it doesn’t disrupt the site?
Thanks again for your help!
October 28, 2020 at 2:24 pm#4310Bob
SupportI’m not a dev, so I hope this question makes sense: If I remove my Plausible code from AMP, will it still help me track mobile traffic?
The mobile yes, but not the AMP pages. I think you should ask the Plausible team about AMP page support, also have a look at this topic https://github.com/plausible/analytics/issues/220
Also, where should I inject the Plausible code so it doesn’t disrupt the site?
Put the code via Custom HTML tool -> Head
--
Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!October 28, 2020 at 2:27 pm#4312HopsWrites
Thanks a ton! Will look into it.
BTW, loving Publii so far! I’ve used Ghost and WordPress, and this is the best of both worlds (great UI with tons of flexibility).
October 29, 2020 at 12:52 am#4316HopsWrites
Bob, thanks again. I checked out the Plausible GitHub issue page and contributed.
I did review Google’s flagging of “custom Javascript, and it flagged Plausible and many other elements from the Body onwards. Are there any others using Publii with this issue? In the meantime, I may turn off AMP.
Thanks!
- AuthorPosts
- You must be logged in to reply to this topic.