psammead-amp-geo component is an
<amp-geo> element to be used for AMP pages. It has a defined set of ISO country groups that we set for our privacy and cookie banners on AMP pages.
npm install @bbc/psammead-amp-geo
psammead-amp-geo, you should firstly include this script in the head of the page:
Then you can import the AmpGeo component & use it in conjunction with
import AmpGeo from '@bbc/psammead-amp-geo';const Wrapper =<><AmpGeo /><amp ="uniqueId" ="nodisplay"><script="application/json">consents:'user-consent':promptIfUnknownForGeoGroup: 'eea'promptUI: 'promptId'</script></amp-consent></>;
When to use this component
Use this component only on AMP pages when you need to have geo-location constrained to a specific list of countries in the EEA, also including Channel Islands and overseas territories.
psammead-amp-geo is an
Psammead is completely open source. We are grateful for any contributions, whether they be new components, bug fixes or general improvements. Please see our primary contributing guide which can be found at the root of the Psammead respository.
We welcome feedback and help on this work. By participating in this project, you agree to abide by the code of conduct. Please take a moment to read it.
Psammead is Apache 2.0 licensed.