Support » Plugin: AMP » CORS Policy Error on Form submit

  • Resolved Geoff McKay

    (@geoffmckay)


    We have a new WP site in development. (Not live yet)

    There is an issue when AMP is enabled with form submissions for an email subscribe widget.

    Setup:
    Theme: Genesis Ver. 3.3.3
    Genesis Child Theme: Navigation Pro Ver. 1.2.0

    Plugins:
    AMP Ver. 2.1.2
    (AMP is configured for Standard Template Mode)

    Genesis eNews Extended Ver. 2.2.0
    https://wordpress.org/support/plugin/genesis-enews-extended/

    The Genesis eNews Extended Widget is being used in the “After Entry” widget area, so it displays on every post. The Genesis eNews Widget connects to a Mailchimp Email list and is used to encourage visitors to subscribe to an email list.

    The Mailchimp form details are configured correctly, because everything works great in NON AMP mode.

    When AMP is enabled, the re-direct to the Mailchimp success/confirm page for the subscribe fails. Instead, an Empty Error Code is displayed on the originating page.

    The following is displayed in a red box in the subscribe widget area:
    “Your submission failed. The server responded with (code). Please contact the developer of this form processor to improve this message. Learn More”

    There is no error code provided. Just the word “code”.
    The “Learn More” in the error displayed links to:
    https://amp-wp.org/documentation/playbooks/handling-form-submissions/

    Using Google Chrome Inspect, the following errors are detected:
    __amp_source_origin
    from origin ‘https://thesite.url’
    has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

    The Mailchimp “Subscribe” actually works, because the email subscriber details are added to the Mailchimp List. However, the User on the Website is shown the FAIL Warning Message on the originating page, instead of the correct Mailchimp subscribe confirmation page.

    We have tested the Subscribe widget settings using “same window” and/or “new window” options. In either config, the re-direct when the user submits the form (subscribes via the widget) always fails.

    As mentioned, if we disable AMP, it works fine. However, we hope to use the subscribe widget on every page, so we would need to disable AMP site wide to get the widget to work.

    It appears when AMP is enabled, there is a CORS policy error blocking the “re-direct” to the Mailchimp subscription confirmation page.

    We have used this same Plugin (Genesis eNews Extended) for many years with Mailchimp and Genesis Themes. There has never been a issue until we tried this on an AMP site.

    The site is not in production yet, so I can not provide a public link.

    Do you have any suggestions or ideas?
    Thanks so much.
    Geoff

Viewing 2 replies - 16 through 17 (of 17 total)
Viewing 2 replies - 16 through 17 (of 17 total)
  • You must be logged in to reply to this topic.