COS-General

How to troubleshoot issues with AMP

Last updated: April 3, 2017

Available For:

Marketing: Basic, Pro, Enterprise
Sales: N/A

If Google Search Console complains of problems with your AMP pages, the first thing to do is check the validator at: https://validator.ampproject.org

Make sure to enter the AMP version of the URL (i.e. with the param hs_amp=true) into the URL field, and not the canonical blog post URL. You can find this URL within your HubSpot portal by going to an individual blog post and clicking the Show more info button. For example, here's a blog post, specifically pointing out the AMP preview url:


This validator tool provides descriptive error messages on validation errors, and specific line/column numbers in the source to pinpoint exactly where the error is.

In most cases, the invalid HTML is within the blog post content and needs to be fixed manually. To fix these issues, you'll want to do the following:

  • From your HubSpot Marketing account, navigate to Content > Blog > locate and hover of the blog post with the error to edit until you see the Actions buttons > click Edit.
  • Click into the post body of your blog post and make the necessary changes.
    • Depending on what error you need to fix, it might be helpful to make any changes within the source code so you can make changes to the HTML in order to validate your content.

 

Some of the most common issues you're likely to run into with AMP are as follows:

The attribute 'style' may not appear in tag 'div'. This is almost always due to a Wistia embed code, which is not yet natively supported in AMP pages. HubSpot has plans to add automatic support for them in HubSpot AMP pages in future.
The tag 'script' is disallowed except in specific forms. This is almost always due to a Wistia embed code, which is not yet natively supported in AMP pages. HubSpot has plans to add automatic support for them in HubSpot AMP pages in future.
The attribute 'style' may not appear in tag 'span'. This is almost always due to a Wistia embed code, which is not yet natively supported in AMP pages. HubSpot has plans to add automatic support for them in HubSpot AMP pages in future.
Malformed URL '...' for attribute 'href' in tag 'a'. Bad link URL in the post body.
Invalid URL protocol '...' for attribute 'href' in tag 'a'.  Bad link URL in the post body.