gatsby-plugin-google-gtag 4.6.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.6.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-google-gtag@4.6.0/packages/gatsby-plugin-google-gtag) (2022-01-25)
7
+
8
+ [🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.6)
9
+
10
+ **Note:** Version bump only for package gatsby-plugin-google-gtag
11
+
6
12
  ## [4.5.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-google-gtag@4.5.0/packages/gatsby-plugin-google-gtag) (2022-01-11)
7
13
 
8
14
  [🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.5)
package/README.md CHANGED
@@ -46,6 +46,8 @@ module.exports = {
46
46
  respectDNT: true,
47
47
  // Avoids sending pageview hits from custom paths
48
48
  exclude: ["/preview/**", "/do-not-track/me/too/"],
49
+ // Defaults to https://www.googletagmanager.com
50
+ origin: "YOUR_SELF_HOSTED_ORIGIN",
49
51
  },
50
52
  },
51
53
  },
package/gatsby-ssr.js CHANGED
@@ -9,19 +9,20 @@ var _minimatch = require("minimatch");
9
9
  exports.onRenderBody = function (_ref, pluginOptions) {
10
10
  var setHeadComponents = _ref.setHeadComponents,
11
11
  setPostBodyComponents = _ref.setPostBodyComponents;
12
- if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test") return null; // Lighthouse recommends pre-connecting to google tag manager
12
+ if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test") return null;
13
+ var gtagConfig = pluginOptions.gtagConfig || {};
14
+ var pluginConfig = pluginOptions.pluginConfig || {};
15
+ var origin = pluginConfig.origin || "https://www.googletagmanager.com"; // Lighthouse recommends pre-connecting to google tag manager
13
16
 
14
17
  setHeadComponents([/*#__PURE__*/_react.default.createElement("link", {
15
18
  rel: "preconnect",
16
19
  key: "preconnect-google-gtag",
17
- href: "https://www.googletagmanager.com"
20
+ href: origin
18
21
  }), /*#__PURE__*/_react.default.createElement("link", {
19
22
  rel: "dns-prefetch",
20
23
  key: "dns-prefetch-google-gtag",
21
- href: "https://www.googletagmanager.com"
22
- })]);
23
- var gtagConfig = pluginOptions.gtagConfig || {};
24
- var pluginConfig = pluginOptions.pluginConfig || {}; // Prevent duplicate or excluded pageview events being emitted on initial load of page by the `config` command
24
+ href: origin
25
+ })]); // Prevent duplicate or excluded pageview events being emitted on initial load of page by the `config` command
25
26
  // https://developers.google.com/analytics/devguides/collection/gtagjs/#disable_pageview_tracking
26
27
 
27
28
  gtagConfig.send_page_view = false;
@@ -46,7 +47,7 @@ exports.onRenderBody = function (_ref, pluginOptions) {
46
47
  return setComponents([/*#__PURE__*/_react.default.createElement("script", {
47
48
  key: "gatsby-plugin-google-gtag",
48
49
  async: true,
49
- src: "https://www.googletagmanager.com/gtag/js?id=" + firstTrackingId
50
+ src: origin + "/gtag/js?id=" + firstTrackingId
50
51
  }), /*#__PURE__*/_react.default.createElement("script", {
51
52
  key: "gatsby-plugin-google-gtag-config",
52
53
  dangerouslySetInnerHTML: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gatsby-plugin-google-gtag",
3
3
  "description": "Gatsby plugin to add google gtag onto a site",
4
- "version": "4.6.0",
4
+ "version": "4.7.0",
5
5
  "author": "Tyler Buchea <tyler@buchea.com>",
6
6
  "bugs": {
7
7
  "url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -13,7 +13,7 @@
13
13
  "devDependencies": {
14
14
  "@babel/cli": "^7.15.4",
15
15
  "@babel/core": "^7.15.5",
16
- "babel-preset-gatsby-package": "^2.6.0",
16
+ "babel-preset-gatsby-package": "^2.7.0",
17
17
  "cross-env": "^7.0.3"
18
18
  },
19
19
  "homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-gtag#readme",
@@ -43,5 +43,5 @@
43
43
  "engines": {
44
44
  "node": ">=14.15.0"
45
45
  },
46
- "gitHead": "441e6da3e1659e73621492a37a47745d308a565f"
46
+ "gitHead": "1f30882907b20b63df4d63b97a80b233a7da37f8"
47
47
  }