Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
[translators] Update translators branch with master πŸ“š (#5944)
Browse files Browse the repository at this point in the history
* fix: signup provider send null (#5935)

* translations: πŸ“š sync translations with crowdin (#5939)

Co-authored-by: DerivFE <[email protected]>

* Habib/gtm party town integration (#5943)

* chore: add gtm to partytown url fix

* chore: add partytown proxy to gtm

* chore: remove semicolon

* chore: remove semicolon

---------

Co-authored-by: NikitK-deriv <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: DerivFE <[email protected]>
Co-authored-by: Habib Deriv <[email protected]>
  • Loading branch information
4 people authored Nov 15, 2023
1 parent 35b9b0c commit a3899ed
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 65 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ env:
GATSBY_GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GATSBY_GROWTHBOOK_DECRYPTION_KEY }}
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 }}

jobs:
release-beta:
timeout-minutes: 30
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/generate-preview-link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ jobs:
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_STRAPI_TOKEN: ${{ secrets.GATSBY_STRAPI_TOKEN }}
GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }}

run: npm run build

- name: Publish to Cloudflare Pages
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:
GATSBY_GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GATSBY_GROWTHBOOK_DECRYPTION_KEY }}
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 }}

jobs:
release-production:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_STRAPI_TOKEN: ${{ secrets.GATSBY_STRAPI_TOKEN }}
GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID: ${{ secrets.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID }}

jobs:
release-staging:
Expand Down
7 changes: 0 additions & 7 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,6 @@ module.exports = {
],
},
},
{
resolve: 'gatsby-plugin-google-tagmanager',
options: {
id: 'GTM-NF7884S',
includeInDevelopment: false,
},
},
{
resolve: 'gatsby-plugin-anchor-links',
options: {
Expand Down
50 changes: 30 additions & 20 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,39 @@ import './src/components/localization/config'
import GlobalProvider from './src/store/global-provider'

export const wrapRootElement = ({ element }) => {
return <GlobalProvider>{element}</GlobalProvider>
return <GlobalProvider>{element}</GlobalProvider>
}

export const wrapPageElement = WrapPagesWithLocaleContext

export const onRenderBody = ({ setHeadComponents }) => {
setHeadComponents([
<script
key="partytown-vanilla-config"
dangerouslySetInnerHTML={{
__html: `partytown = {
resolveUrl(url, location) {
// Use a secure connection
if (url?.protocol === 'http:') {
url = new URL(url.href.replace('http', 'https'))
}
// Point to our proxied URL
const proxyUrl = new URL(location.origin + '/__third-party-proxy')
proxyUrl.searchParams.append('url', url)
return proxyUrl
}
}`,
}}
/>,
])
const gtmTrackingId = process.env.GATSBY_GOOGLE_TAG_MANAGER_TRACKING_ID || ''

setHeadComponents([
<script
key="partytown-vanilla-config"
dangerouslySetInnerHTML={{
__html: `partytown = {
resolveUrl(url, location) {
// Use a secure connection
if (url?.protocol === 'http:') {
url = new URL(url.href.replace('http', 'https'))
}
// Point to our proxied URL
const proxyUrl = new URL(location.origin + '/__third-party-proxy')
proxyUrl.searchParams.append('url', url)
return proxyUrl
}
}`,
}}
/>,
gtmTrackingId && (
<script
key="gtm-script"
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl+'';f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer', '${gtmTrackingId}');`,
}}
/>
),
])
}
Loading

0 comments on commit a3899ed

Please sign in to comment.