Skip to content

Commit 3eee26e

Browse files
committed
Revert "#000 | refactor: migrate from Google Analytics to gtag and optimize site performance"
This reverts commit 82010a9.
1 parent 03cd67f commit 3eee26e

File tree

16 files changed

+125
-194
lines changed

16 files changed

+125
-194
lines changed

Makefile

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
1-
# Speedier defaults and robust targets
2-
.PHONY: start deps clean build serve
3-
4-
NPM_FLAGS ?= --prefer-offline --no-audit --no-fund
51

62
start:
73
npm run develop
84

95
deps:
10-
@if [ -d node_modules ]; then \
11-
npm i $(NPM_FLAGS); \
12-
else \
13-
npm ci $(NPM_FLAGS); \
14-
fi
6+
npm i
157

168
clean:
17-
rm -rf node_modules
18-
19-
build:
20-
NODE_ENV=production npm run build
21-
22-
serve:
23-
npm run serve
9+
rm -rf node_modules

_headers

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
[[headers]]
22
for = "/static/*"
33
[headers.values]
4-
Cache-Control = "public, max-age=31536000, immutable"
5-
6-
[[headers]]
7-
for = "/page-data/*"
8-
[headers.values]
9-
Cache-Control = "public, max-age=31536000, immutable"
4+
Cache-Control = "public, max-age=360000"

gatsby-config.js

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,31 @@ module.exports = {
1111
},
1212
plugins: [
1313
{
14-
resolve: `gatsby-plugin-google-gtag`,
14+
resolve: `gatsby-plugin-google-analytics`,
1515
options: {
16-
trackingIds: [
17-
'G-Y3E7H5MDX8',
18-
'AW-17511540130'
19-
],
20-
gtagConfig: {
21-
anonymize_ip: true,
22-
},
23-
pluginConfig: {
24-
head: false,
25-
respectDNT: true,
26-
delayOnRouteUpdate: 0,
27-
exclude: ['/preview/**', '/do-not-track/**'],
28-
},
16+
trackingId: "UA-151665102-1",
17+
// Defines where to place the tracking script - `true` in the head and `false` in the body
18+
head: false,
19+
// Setting this parameter is optional
20+
anonymize: true,
21+
// Setting this parameter is also optional
22+
respectDNT: true,
23+
// Avoids sending pageview hits from custom paths
24+
exclude: ["/do-not-track/example/"],
25+
// Delays sending pageview hits on route update (in milliseconds)
26+
pageTransitionDelay: 0,
27+
defer: true,
28+
enableWebVitalsTracking: true,
29+
// Enables Google Optimize using your container Id
30+
// optimizeId: "YOUR_GOOGLE_OPTIMIZE_TRACKING_ID",
31+
// Enables Google Optimize Experiment ID
32+
// experimentId: "YOUR_GOOGLE_EXPERIMENT_ID",
33+
// Set Variation ID. 0 for original 1,2,3....
34+
// variationId: "YOUR_GOOGLE_OPTIMIZE_VARIATION_ID",
35+
// Any additional optional fields
36+
// sampleRate: 5,
37+
// siteSpeedSampleRate: 10,
38+
// cookieDomain: "example.com",
2939
},
3040
},
3141
'gatsby-plugin-react-helmet',
@@ -100,20 +110,26 @@ module.exports = {
100110
},
101111
},
102112
{
103-
resolve: 'gatsby-plugin-webpack-bundle-analyser-v2',
113+
resolve: 'gatsby-plugin-google-tagmanager',
104114
options: {
105-
analyzerMode: 'static',
106-
reportFilename: 'bundle-report.html',
107-
openAnalyzer: false,
108-
disable: !process.env.ANALYZE_BUNDLE,
115+
id: 'AW-17511540130',
116+
// Optional: Include in development environment
117+
includeInDevelopment: false,
118+
// Optional: Default data layer values
119+
defaultDataLayer: {platform: 'gatsby'},
120+
// Optional: Respect Do Not Track (DNT) browser setting
121+
respectDNT: true,
122+
// Optional: Exclude certain paths from tracking
123+
exclude: ['/preview/**', '/do-not-track/'],
124+
// Optional: Delay pageview event on route updates (e.g., for page transitions)
125+
delayOnRouteUpdate: 0,
109126
},
110127
},
111128
{
112129
resolve: 'gatsby-plugin-purgecss', // purges all unused/unreferenced css rules
113130
options: {
114131
develop: true, // Activates purging in npm run develop
115132
purgeOnly: ['/all.sass'], // applies purging only on the bulma css file
116-
printRejected: true,
117133
},
118134
}, // must be after other CSS plugins
119135
'gatsby-plugin-netlify', // make sure to keep it last in the array

gatsby-ssr.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
import React from "react";
22

3-
export const onRenderBody = () => {};
3+
export const onRenderBody = ({ setHeadComponents }) => {
4+
setHeadComponents([
5+
<script
6+
key="google-ads-tag"
7+
async
8+
src="https://www.googletagmanager.com/gtag/js?id=AW-17511540130"
9+
/>,
10+
<script
11+
key="google-ads-inline"
12+
dangerouslySetInnerHTML={{
13+
__html: `
14+
window.dataLayer = window.dataLayer || [];
15+
function gtag(){dataLayer.push(arguments);}
16+
gtag('js', new Date());
17+
gtag('config', 'AW-17511540130');
18+
`,
19+
}}
20+
/>,
21+
]);
22+
};

optimize-hero.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,18 @@
66
"dependencies": {
77
"bulma": "^0.9.1",
88
"fs-extra": "^8.1.0",
9-
"@loadable/component": "^5.15.2",
109
"gatsby": "^2.24.78",
1110
"gatsby-image": "^2.11.0",
1211
"gatsby-plugin-catch-links": "^5.14.0",
13-
"gatsby-plugin-google-gtag": "^1.2.0",
14-
"gatsby-plugin-loadable-components-ssr": "^2.1.0",
12+
"gatsby-plugin-google-analytics": "^2.3.18",
13+
"gatsby-plugin-google-tagmanager": "^2.0.15",
1514
"gatsby-plugin-netlify": "^2.3.19",
1615
"gatsby-plugin-netlify-cms": "^4.3.16",
1716
"gatsby-plugin-purgecss": "^5.0.0",
1817
"gatsby-plugin-react-helmet": "^3.3.14",
1918
"gatsby-plugin-sass": "^2.3.16",
2019
"gatsby-plugin-sharp": "^2.14.4",
2120
"gatsby-plugin-sitemap": "^2.4.17",
22-
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.32",
2321
"gatsby-plugin-typography": "^2.5.13",
2422
"gatsby-remark-copy-linked-files": "^2.3.19",
2523
"gatsby-remark-embed-video": "^3.0.10",
@@ -38,10 +36,12 @@
3836
"parcel-bundler": "^1.12.4",
3937
"prop-types": "^15.7.2",
4038
"react": "^16.14.0",
39+
"react-calendly": "^1.1.3",
4140
"react-dom": "^16.14.0",
4241
"react-google-recaptcha": "^3.1.0",
4342
"react-helmet": "^6.1.0",
4443
"react-phone-number-input": "^3.4.12",
44+
"react-share": "^4.3.1",
4545
"react-typography": "^0.16.19",
4646
"rss": "^1.2.2",
4747
"sharp": "^0.26.2",
@@ -61,7 +61,6 @@
6161
"build:app": "npm run clean && gatsby build",
6262
"build:lambda": "netlify-lambda build src/lambda",
6363
"build": "run-p build:**",
64-
"analyze": "ANALYZE_BUNDLE=true gatsby build",
6564
"develop": "npm run clean && gatsby develop",
6665
"serve": "gatsby serve",
6766
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"{gatsby-*.js,src/**/*.js}\"",

src/components/LandingPageHero.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import React from "react";
22
import Navbar from "./Navbar"
33
// import banner from '../img/cover.png'
44
// import DiwaliBanner from '../img/diwali-banner.jpg'
5+
import {PopupText} from "react-calendly";
56
import Constants from "../Constants";
67
import SecondaryCTAButton from "./SecondaryCTAButton";
78
import Img from "gatsby-image";
89
import {graphql, useStaticQuery} from 'gatsby';
9-
import { Helmet } from "react-helmet";
1010

1111
let subtitle = function (text) {
1212
return <p
@@ -24,23 +24,15 @@ export default function LandingPageHero() {
2424
query {
2525
file(relativePath: { eq: "cover.png" }) {
2626
childImageSharp {
27-
fluid(maxWidth: 2000, quality: 70, toFormat: JPG) {
28-
...GatsbyImageSharpFluid_withWebp
27+
fluid {
28+
...GatsbyImageSharpFluid_withWebp_tracedSVG
2929
}
3030
}
3131
}
3232
}
3333
`)
3434
return (
3535
<div>
36-
<Helmet>
37-
<link
38-
rel="preload"
39-
as="image"
40-
href={data.file.childImageSharp.fluid.src}
41-
imagesrcset={data.file.childImageSharp.fluid.srcSet}
42-
/>
43-
</Helmet>
4436
<div className="hero-head">
4537
<Navbar/>
4638
</div>
@@ -91,12 +83,11 @@ export default function LandingPageHero() {
9183
<div style={{paddingTop: '1rem', flexDirection: 'column', display: 'flex', alignItems: 'center'}}>
9284
<SecondaryCTAButton text="Try for free" link={`/signup?${Constants.ContactSource}=${Constants.Trial}`}/>
9385
<p className="button is-primary is-medium" style={{marginTop: 10}}>
94-
<a
95-
href="https://calendly.com/avnisupport-samanvayfoundation/product-demo-and-discussion"
96-
style={{color: 'white', fontWeight: 'bold'}}
97-
>
98-
Schedule a Demo
99-
</a>
86+
<PopupText
87+
text="Schedule a Demo"
88+
url="https://calendly.com/avnisupport-samanvayfoundation/product-demo-and-discussion"
89+
styles={{color: 'white', fontWeight: 'bold'}}
90+
/>
10091
</p>
10192
</div>
10293
</div>

src/components/Navbar.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {Link} from 'gatsby'
33
import logo from '../img/avni-logo-color.png'
44
import {Location} from '@reach/router'
55
import Constants from "../Constants";
6+
import {PopupText} from "react-calendly";
67

78

89
export default class Navbar extends React.Component {
@@ -49,10 +50,7 @@ export default class Navbar extends React.Component {
4950
src={logo}
5051
alt="avni"
5152
className="logo"
52-
width="276"
53-
height="81"
54-
decoding="async"
55-
style={{height: '50px', width: 'auto'}}
53+
style={{height: '50px'}}
5654
/>
5755
</Link>
5856
</div>
@@ -138,12 +136,11 @@ export default class Navbar extends React.Component {
138136
)
139137
}
140138
<p className="button is-primary" style={{marginRight: 12}}>
141-
<a
142-
href="https://calendly.com/avnisupport-samanvayfoundation/product-demo-and-discussion"
143-
style={{color:'white', fontWeight:'bold'}}
144-
>
145-
Schedule a Demo
146-
</a>
139+
<PopupText
140+
text="Schedule a Demo"
141+
url="https://calendly.com/avnisupport-samanvayfoundation/product-demo-and-discussion"
142+
styles={{color:'white', fontWeight:'bold'}}
143+
/>
147144
</p>
148145
</div>
149146
</div>

src/components/Plan.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import {PopupText} from "react-calendly";
23

34
let step = function (title, text) {
45
return <div className="columns">
@@ -23,12 +24,11 @@ const Plan = ({}) => (
2324
<div className="column is-one-third"/>
2425
<div className="column is-one-third has-text-centered">
2526
<p className="button is-primary is-medium">
26-
<a
27-
href="https://calendly.com/avnisupport-samanvayfoundation/product-demo-and-discussion"
28-
style={{color: 'white', fontWeight: 'bold'}}
29-
>
30-
Schedule a Demo
31-
</a>
27+
<PopupText
28+
text="Schedule a Demo"
29+
url="https://calendly.com/avnisupport-samanvayfoundation/product-demo-and-discussion"
30+
styles={{color: 'white', fontWeight: 'bold'}}
31+
/>
3232
</p>
3333
</div>
3434
<div className="column is-one-third"/>

0 commit comments

Comments
 (0)