2

I am working on an amp-story; but can't seem to get a amp-consent modal without utilizing the amp-story-consent default UI. I would like to use a amp-iframe, or just a plain html modal, but neither will render.

Anybody have any luck with this?

Iframe:

<amp-consent layout="nodisplay" id="gdpr-consent-element">
        <script type="application/json">
            {
                "consents": {
                    "cbsiampconsent": {
                        "promptIfUnknownForGeoGroup": "eea",
                        "promptUI": "consentDialog"
                    }
                }
            }
        </script>
        <div id="consentDialog" style="position: absolute; widht: 500px; height: 500px;">
            <amp-iframe width="200" height="100"
                        sandbox="allow-scripts allow-same-origin"
                        layout="responsive"
                        frameborder="0"
                        src="https://www.google.com/maps/embed/v1/place?key=AIzaSyDG9YXIhKBhqclZizcSzJ0ROiE0qgVfwzI&q=iceland">
            </amp-iframe>
        </div>
    </amp-consent>

1 Answers1

2

This is not possible; the only supported consent UI is the default UI that you have mentioned.

See the amp-story-consent documentation and example for more details.

Jon Newmuis
  • 25,722
  • 2
  • 45
  • 57
  • Yeah, that is what I was looking at also. The strange thing, if you look at the example you posted and scroll to the bottom it mentions using a iframe; but is commented out. That is why I reached out, to see if anyone had done something differently. Thanks for the response though! – GrizzlyEnglish Nov 12 '18 at 21:56
  • The example is misleading. The snippet in the documentation doesn't have any story pages or story bookend. However the playground variant does have. The problem is, that a simple consent dialog also doesn't have any pages. How to get this working with a cookie consent? https://stackoverflow.com/questions/61929226/how-to-construct-amp-cookie-consent-with-the-help-of-amp-story-consent – Csaba Toth May 21 '20 at 21:10