This package has been deprecated

Author message:

This package is no longer being maintained

@bbc/psammead-amp-geo

1.2.5 • Public • Published

psammead-amp-geo - Known Vulnerabilities Dependency Status peerDependencies Status Storybook GitHub license npm version PRs Welcome

Description

The 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 ('eea'), and a defined set of ISO country groups to detect if a user should not be shown ads ('gbOrUnknown').

Installation

npm install @bbc/psammead-amp-geo

Props

Argument Type Required Default Example
No props.

Usage

When using psammead-amp-geo, you should firstly include this script in the head of the page:

<script
  async
  custom-element="amp-geo"
  src="https://cdn.ampproject.org/v0/amp-geo-0.1.js"
/>

Then you can import the AmpGeo component & use it in conjunction with <amp-consent>

import AmpGeo from '@bbc/psammead-amp-geo';

const Wrapper = () => (
  <>
    <AmpGeo />
      <amp-consent id="uniqueId" layout="nodisplay">
      <script
        type="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 either the EEA, also including Channel Islands and overseas territories ('eea'),
  • or if you need to detect if a user should not be shown ads based on geo-location ('gbOrUnknown').

Accessibility notes

The psammead-amp-geo is an <amp-geo> element.

Contributing

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.

Code of Conduct

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.

License

Psammead is Apache 2.0 licensed.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

Package Sidebar

Install

npm i @bbc/psammead-amp-geo

Weekly Downloads

1

Version

1.2.5

License

Apache-2.0

Unpacked Size

9.86 kB

Total Files

8

Last publish

Collaborators

  • neha0508
  • arunbhari11
  • tomchamberlainuk
  • david-boydell
  • ashtuckbbc
  • geoffbbc
  • simon_taylor
  • jodiw_bbc
  • craigj
  • danm
  • jim-johnson-rollings
  • matt-rhys-jones-bbc
  • lewer
  • ben_newcombe
  • thomam67
  • locator-deploy
  • bbc-online
  • eagerterrier_bbc
  • coderkind
  • leobs
  • leedriscoll
  • cardl01
  • joshcoventry
  • news-vj-bot
  • silver-jenkins
  • bbc-web-core
  • ibl-jenkins
  • iplayer-web-jenkins
  • sport-web-jenkins
  • bbcconnections
  • bbc-gnl-ci
  • bbc-morph
  • itv-ci-machine
  • audienceplatformdev
  • bbc-archivesearch-development-team
  • sounds-web-jenkins
  • rmsdev
  • bbc-voice-pipeline
  • weather-jenkins
  • newslabs-jenkins
  • api-management-jenkins
  • mdtbuild
  • cps-support
  • bbc-cd-jenkins
  • bbc-isite
  • travel-jenkins
  • participation-jenkins
  • bbc-news-jenkins
  • bbcrd
  • ibl
  • iplayerradio-aws
  • media-playout-jenkins
  • partner-platform-jenkins
  • bbc-admin
  • gel-jenkins
  • pcs-amp-jenkins
  • education-jenkins
  • insyn-jenkins
  • kite-jenkins
  • bbcrd-artifactory
  • iplayer-pc-downloads-pipeline-bot