Sign in

Google AMP Issue: “Custom Javascript Not Allowed”

  • This topic has 7 replies, 2 voices, and was last updated 1 year, 1 month ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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

    #4306
    Bob

    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
    HopsWrites

    Here’s the URL:

    https://blog.hopswrites.com/

    #4308
    Bob

    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
    HopsWrites

    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
    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?

    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
    HopsWrites

    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
    HopsWrites

    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.