@chordcommerce/gatsby-theme-autonomy
v1.2.0+, our Gatsby Performance starter makes use of Segment's Consent Manager by default. This document describes the front-end configuration and technical implementation details.analytics.js
load process to only load destinations that the user has consented to, and not loading analytics.js
at all if the user has opted out of everything. tracking-preferences
):manualLoad
setting in your gatsby-config.js
file, as follow:/src/components/Segment/ConsentManager/index.jsx
. shouldRequireConsent
method of the component to alter that behavior.GATSBY_SEGMENT_SHOULD_REQUIRE_CONSENT
environment variable to true
in your .env
file. /src/components/Segment/ConsentManager/index.jsx
. In there, you can tweak various properties (or see example below):gatsby-browser.js
file:Consent Manager
to work, you must setup Segment integrations in your target Segment workspace.Consent Manager
component by visiting the URL below. The response should not return an empty array if you have properly configured them. ConsentManagerWrapper
component, make sure that the {children}
prop coming from the wrapRootElement is placed before the <ConsentManager />
node:yarn dev
).Consent Manager
, and keep tracking your visitors automatically, please follow those steps:"@segment/consent-manager"
from your package.json
manualLoad
to false in the segmentConfig
section of your gatsby-config.js. This will load our Segment plugin (contains in our theme) automatically, since Consent Manager has been removed. Tracking will kick in immediately on first page load.