File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 11GATSBY_GTM_ID = GTM-XXXXXXX
2- GATSBY_GTM_SUPPORT = false
2+ GATSBY_GTM_SUPPORT = false
3+ GATSBY_COOKIE3_SITE_ID = XXXXXXXXXXXXXXXX
Original file line number Diff line number Diff line change 3636 env :
3737 PUBLIC_URL : /${{ github.head_ref }}
3838 GATSBY_SUBGRAPH_API_KEY : ${{ secrets.SUBGRAPH_API_KEY }}
39+ GATSBY_COOKIE3_SITE_ID : ${{ secrets.COOKIE3_SITE_ID }}
3940
4041 - name : Build
4142 if : github.event_name == 'push'
4849 GATSBY_GTM_SUPPORT : true
4950 GATSBY_GTM_ID : ${{ secrets.GTM_ID }}
5051 GATSBY_SUBGRAPH_API_KEY : ${{ secrets.SUBGRAPH_API_KEY }}
52+ GATSBY_COOKIE3_SITE_ID : ${{ secrets.COOKIE3_SITE_ID }}
5153
5254 - uses : actions/upload-artifact@v4
5355 with :
Original file line number Diff line number Diff line change 1+ import React from "react"
2+ import type { GatsbySSR } from "gatsby"
3+
4+ const COOKIE3_SCRIPT_VERSION = "0.11.24"
5+
6+ export const onRenderBody : GatsbySSR [ "onRenderBody" ] = ( {
7+ setHeadComponents,
8+ } ) => {
9+ if ( process . env . GATSBY_COOKIE3_SITE_ID ) {
10+ setHeadComponents ( [
11+ < script
12+ key = "cookie3-analytics"
13+ src = { `https://cdn.markfi.xyz/scripts/analytics/${ COOKIE3_SCRIPT_VERSION } /cookie3.analytics.min.js` }
14+ integrity = "sha384-lp8ATuGdLnhwAutE0SOVmSINtZ4DObSNjODmbbjYxaX92FOPBLyZjN+wVIaoK4Qy"
15+ crossOrigin = "anonymous"
16+ { ...{ "site-id" : process . env . GATSBY_COOKIE3_SITE_ID } }
17+ async = { true }
18+ /> ,
19+ ] )
20+ }
21+ }
22+
123export { wrapPageElement } from "./gatsby-browser"
You can’t perform that action at this time.
0 commit comments