diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index efa6c43575c..0bbdf907794 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -23,6 +23,7 @@ env: GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }} GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }} GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} + GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} jobs: release-beta: diff --git a/.github/workflows/generate-preview-link.yml b/.github/workflows/generate-preview-link.yml index e9332099fb0..f415de08ec7 100644 --- a/.github/workflows/generate-preview-link.yml +++ b/.github/workflows/generate-preview-link.yml @@ -130,6 +130,8 @@ jobs: GATSBY_STRAPI_TOKEN: ${{ secrets.GATSBY_STRAPI_TOKEN }} GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} + GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + run: npm run build - name: Publish to Cloudflare Pages diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 33a790f8336..f8c85f08e1d 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -20,6 +20,7 @@ env: GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }} GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} + GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} jobs: release-production: @@ -52,7 +53,7 @@ jobs: - run: npm run test - run: npm run build - run: echo $GIT_TAG_NAME > public/version.txt - + - name: Remove Storybook uses: JesseTG/rm@v1.0.2 with: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 5c3d3ce02fd..a1937a30ea9 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -25,6 +25,8 @@ env: GATSBY_STRAPI_TOKEN: ${{ secrets.GATSBY_STRAPI_TOKEN }} GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }} GATSBY_TRUSTPILOT_API_KEY: ${{ secrets.GATSBY_TRUSTPILOT_API_KEY }} + GATSBY_HOTJAR_ID: ${{ secrets.GATSBY_HOTJAR_ID }} + jobs: release-staging: timeout-minutes: 30 diff --git a/gatsby-ssr.js b/gatsby-ssr.js index 4a68d992d1d..0b777043160 100644 --- a/gatsby-ssr.js +++ b/gatsby-ssr.js @@ -12,6 +12,7 @@ export const wrapPageElement = WrapPagesWithLocaleContext export const onRenderBody = ({ setHeadComponents }) => { const gtmTrackingId = process.env.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID || '' + const hotjarId = process.env.GATSBY_HOTJAR_ID || '' setHeadComponents([ // Partytown setup @@ -51,5 +52,25 @@ export const onRenderBody = ({ setHeadComponents }) => { }} /> ), + + // Hotjar setup + hotjarId && ( +