Skip to content

Commit

Permalink
#41 tested the google tag manager to id shops clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaNovo committed May 18, 2020
1 parent e912ec5 commit 5359dc3
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 8 deletions.
20 changes: 19 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,25 @@ module.exports = {
{
resolve: 'gatsby-plugin-google-analytics',
options: {
trackingId: 'UA-162021632-1',
// trackingId: 'UA-162021632-1',
trackingId: 'UA-166369673-1', // I put my account just to test the tagmanager
},
},
{
resolve: 'gatsby-plugin-google-tagmanager',
options: {
id: 'GTM-52RL5N9', // I put my account just to test the tagmanager

// Include GTM in development.
// Defaults to false meaning GTM will only be loaded in production.
includeInDevelopment: true,

// datalayer to be set before GTM is loaded
// should be an object or a function that is executed in the browser
// Defaults to null
defaultDataLayer: {
platform: 'gatsby',
},
},
},
{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"gatsby-node-helpers": "^0.3.0",
"gatsby-plugin-alias-imports": "^1.0.5",
"gatsby-plugin-google-analytics": "^2.2.2",
"gatsby-plugin-google-tagmanager": "^2.3.1",
"gatsby-plugin-manifest": "^2.2.48",
"gatsby-plugin-material-ui": "^2.1.6",
"gatsby-plugin-netlify-cms": "^4.2.4",
Expand Down
20 changes: 13 additions & 7 deletions src/components/Shops/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,35 @@ const ShopsCard = ({ shop }) => {
}) }
disableRipple
onClick={ handleExpandClick }
id={ `click-tracker__${shop.name}__action-area` }
data-shop={ shop.name }
>
<CardContent className={ classes.content }>
<Typography gutterBottom variant="h5" component="h2" className={ classes.title }>
<CardContent className={ classes.content } id={ `click-tracker__${shop.name}__card-content` } data-shop={ shop.name }>
<Typography gutterBottom variant="h5" component="h2" className={ classes.title } id={ `click-tracker__${shop.name}__name` } data-shop={ shop.name }>
{ shop.name }
</Typography>
<Typography variant="body2" color="textSecondary" component="p" className={ classes.location }>
<Typography variant="body2" color="textSecondary" component="p" className={ classes.location } id={ `click-tracker__${shop.name}__location` } data-shop={ shop.name }>
{ shop.location.join(', ') }
</Typography>
<Typography variant="body2" color="textSecondary" component="p" className={ classes.businessType }>
<Typography variant="body2" color="textSecondary" component="p" className={ classes.businessType } id={ `click-tracker__${shop.name}__business-type` } data-shop={ shop.name }>
{ shop.businessType.join(', ') }
</Typography>
<Typography variant="body2" color="textSecondary" component="p" className={ classes.product }>
<Typography variant="body2" color="textSecondary" component="p" className={ classes.product } id={ `click-tracker__${shop.name}__product` } data-shop={ shop.name }>
{ shop.product }
</Typography>
</CardContent>

<CardActions
classes={ {
id={ `click-tracker__${shop.name}__card-actions` }
data-shop={ shop.name }
classes={ clsx({
root: classes.cardActions,
} }
}) }
disableSpacing
>
<ExpandMoreIcon
id={ `click-tracker__${shop.name}__expand-icon` }
data-shop={ shop.name }
className={ clsx(classes.expand, {
[classes.expandOpen]: expanded,
}) }
Expand Down
14 changes: 14 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,13 @@
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.9.6":
version "7.9.6"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.9.6.tgz#a9102eb5cadedf3f31d08a9ecf294af7827ea29f"
integrity sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==
dependencies:
regenerator-runtime "^0.13.4"

"@babel/standalone@^7.9.5":
version "7.9.5"
resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.9.5.tgz#aba82195a39a8ed8ae56eacff72cf2bda551a7c3"
Expand Down Expand Up @@ -6790,6 +6797,13 @@ gatsby-plugin-google-analytics@^2.2.2:
"@babel/runtime" "^7.8.7"
minimatch "3.0.4"

gatsby-plugin-google-tagmanager@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/gatsby-plugin-google-tagmanager/-/gatsby-plugin-google-tagmanager-2.3.1.tgz#377824a10eacaf209b962527750647d2562bb8a5"
integrity sha512-8d6KwBKAeB3MxUuDfKuJG2gcqrLNIyUACd83D99hXSsqLNChTB5uRBq+0pfPtUEEqVpNvzr45wvxNUYwcmHTuA==
dependencies:
"@babel/runtime" "^7.9.6"

gatsby-plugin-manifest@^2.2.48:
version "2.3.7"
resolved "https://registry.yarnpkg.com/gatsby-plugin-manifest/-/gatsby-plugin-manifest-2.3.7.tgz#f4fdb4dc04a4dec2b669f5e49c959e7e687cf7c7"
Expand Down

0 comments on commit 5359dc3

Please sign in to comment.