diff --git a/.env.example b/.env.example index 5dbecc20e..c3991a5f6 100644 --- a/.env.example +++ b/.env.example @@ -3,3 +3,4 @@ GATSBY_NETWORK="rinkeby" #GATSBY_INFURA_PROJECT_ID="xxx" #GATSBY_MARKET_FEE_ADDRESS="0xxx" +#GATSBY_ANALYTICS_ID="xxx" \ No newline at end of file diff --git a/app.config.js b/app.config.js index 6801d707d..306d167ea 100644 --- a/app.config.js +++ b/app.config.js @@ -32,5 +32,8 @@ module.exports = { classNameDark: 'dark', classNameLight: 'light', storageKey: 'oceanDarkMode' - } + }, + + // Analytics + analyticsId: process.env.GATSBY_ANALYTICS_ID || 'xxx' } diff --git a/gatsby-config.js b/gatsby-config.js index a98dcd013..62f419d40 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -71,7 +71,7 @@ module.exports = { resolve: 'gatsby-plugin-google-analytics', options: { // The property ID; the tracking code won't be generated without it - trackingId: 'UA-60614729-11', + trackingId: appConfig.analyticsId, // Defines where to place the tracking script - `true` in the head and `false` in the body head: false, // Setting this parameter is optional diff --git a/src/hooks/useSiteMetadata.ts b/src/hooks/useSiteMetadata.ts index 4aa5fb6fc..6f51fa8fe 100644 --- a/src/hooks/useSiteMetadata.ts +++ b/src/hooks/useSiteMetadata.ts @@ -19,6 +19,7 @@ const query = graphql` network marketFeeAddress currencies + analyticsId } } }