Sign in

Google AMP Issue: “Custom Javascript Not Allowed”

  • This topic has 7 replies, 2 voices, and was last updated 2 years, 7 months ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #4305
    Avatar photoHopsWrites

    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

    #4306
    Avatar photoBob

    You 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!

    #4307
    Avatar photoHopsWrites

    Here’s the URL:

    https://blog.hopswrites.com/

    #4308
    Avatar photoBob

    The 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!

    #4309
    Avatar photoHopsWrites

    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!

    #4310
    Avatar photoBob

    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?

    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!

    #4312
    Avatar photoHopsWrites

    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).

    #4316
    Avatar photoHopsWrites

    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!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.