Skip to content

Commit

Permalink
add gtm
Browse files Browse the repository at this point in the history
  • Loading branch information
sassdavid committed Feb 19, 2024
1 parent 83a916a commit 13b5947
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 54 deletions.
1 change: 1 addition & 0 deletions .github/workflows/github-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
run: npm run build
env:
GATSBY_GOOGLE_MAPS_API_KEY: ${{ secrets.GATSBY_GOOGLE_MAPS_API_KEY }}
GATSBY_GTM_ID: ${{ secrets.GATSBY_GTM_ID }}
- name: Verify build
run: ls -la public
- name: Setup Pages
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ jobs:
run: npm run build
env:
GATSBY_GOOGLE_MAPS_API_KEY: ${{ secrets.GATSBY_GOOGLE_MAPS_API_KEY }}
GATSBY_GTM_ID: ${{ secrets.GATSBY_GTM_ID }}
12 changes: 12 additions & 0 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import type { GatsbyConfig } from 'gatsby';

require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
})

const config: GatsbyConfig = {
siteMetadata: {
title: 'Bianka & David',
Expand Down Expand Up @@ -31,6 +35,14 @@ const config: GatsbyConfig = {
},
},
},
{
resolve: 'gatsby-plugin-google-tagmanager',
options: {
id: process.env.GATSBY_GTM_ID,
includeInDevelopment: true,
enableWebVitalsTracking: true,
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
Expand Down
43 changes: 23 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@react-google-maps/api": "^2.19.3",
"crypto-js": "^4.2.0",
"gatsby": "^5.13.3",
"gatsby-plugin-google-tagmanager": "^5.13.1",
"gatsby-plugin-image": "^3.13.1",
"gatsby-plugin-manifest": "^5.13.1",
"gatsby-plugin-offline": "^6.13.1",
Expand All @@ -22,7 +23,6 @@
"gatsby-source-filesystem": "^5.13.1",
"gatsby-transformer-sharp": "^5.13.1",
"react": "^18.2.0",
"react-cookie-consent": "^9.0.0",
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
"react-swipeable": "^7.0.1",
Expand Down
33 changes: 0 additions & 33 deletions src/components/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,12 @@
import React from 'react';
import PropTypes from 'prop-types';
import CookieConsent from 'react-cookie-consent';
import { SiGnuprivacyguard } from 'react-icons/si';
import '../assets/scss/main.scss';

const Layout = ({ children }) => {
return (
<>
<div>{children}</div>
<CookieConsent
enableDeclineButton
flipButtons
location="bottom"
buttonText="Elfogad"
declineButtonText="Elutasít"
cookieName="google-analytics"
style={{
background: 'linear-gradient(to right, transparent, #171717)',
textShadow: '2px 2px black',
}}
buttonStyle={{
background: 'radial-gradient(circle at top right, #222, transparent)',
color: 'white',
fontWeight: 'bolder',
borderRadius: '3px',
border: '1px black',
textShadow: '2px 2px black',
}}>
A weboldal cookikat használ a jobb felhasználói élmény elérése érdekében.{' '}
<span
style={{
fontSize: '15px',
textAlign: 'center',
marginLeft: '10px',
}}>
<span className="icon -lock">
<SiGnuprivacyguard />
</span>{' '}
<a href="/privacy" target="_blank" rel="noopener noreferrer">Adatkezelési tájékoztató</a>
</span>
</CookieConsent>
</>
);
};
Expand Down

0 comments on commit 13b5947

Please sign in to comment.