Skip to content

Commit

Permalink
Revert "feat(gatsby-plugin-google-tagmanager): Allow to place the GTM…
Browse files Browse the repository at this point in the history
… script … (#13424)"

This reverts commit 0b56c3b.
  • Loading branch information
sidharthachatterjee authored Apr 19, 2019
1 parent 75c6c34 commit eba9147
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
5 changes: 0 additions & 5 deletions packages/gatsby-plugin-google-tagmanager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ plugins: [
gtmAuth: "YOUR_GOOGLE_TAGMANAGER_ENVIROMENT_AUTH_STRING",
gtmPreview: "YOUR_GOOGLE_TAGMANAGER_ENVIROMENT_PREVIEW_NAME",
dataLayerName: "YOUR_DATA_LAYER_NAME",

// Whether to put the GTM script into the <head> (as suggested by Google)
// or append it to the <body> (making it non-blocking).
// Defaults to false meaning GTM will be added in the <head> (again, as suggested by Google).
addTagInBody: false,
},
},
]
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-google-tagmanager/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gatsby-plugin-google-tagmanager",
"description": "Gatsby plugin to add google tagmanager onto a site",
"version": "2.1.0",
"version": "2.0.13",
"author": "Thijs Koerselman <thijs@vauxlab.com>",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
Expand Down
9 changes: 3 additions & 6 deletions packages/gatsby-plugin-google-tagmanager/src/gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { oneLine, stripIndent } from "common-tags"
import React from "react"
import { oneLine, stripIndent } from "common-tags"

exports.onRenderBody = (
{ setHeadComponents, setPreBodyComponents, setPostBodyComponents },
{ setHeadComponents, setPreBodyComponents },
pluginOptions
) => {
if (
Expand All @@ -18,10 +18,7 @@ exports.onRenderBody = (
`
: ``

const setComponents = pluginOptions.addTagInBody
? setPostBodyComponents
: setHeadComponents
setComponents([
setHeadComponents([
<script
key="plugin-google-tagmanager"
dangerouslySetInnerHTML={{
Expand Down

0 comments on commit eba9147

Please sign in to comment.