Skip to content

Commit

Permalink
Merge pull request #790 from chromaui/fix-analytics
Browse files Browse the repository at this point in the history
update patch to gatsby-plugin-plausible
  • Loading branch information
winkerVSbecks authored Dec 17, 2024
2 parents db7189c + 7b204d3 commit 5e44d46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions patches/gatsby-plugin-plausible+0.0.7.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff --git a/node_modules/gatsby-plugin-plausible/gatsby-ssr.js b/node_modules/gatsby-plugin-plausible/gatsby-ssr.js
index c00d563..785cddd 100755
index c00d563..41e80ba 100755
--- a/node_modules/gatsby-plugin-plausible/gatsby-ssr.js
+++ b/node_modules/gatsby-plugin-plausible/gatsby-ssr.js
@@ -7,8 +7,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
var _react = _interopRequireDefault(require("react"));

var getOptions = function getOptions(pluginOptions) {
- var plausibleDomain = pluginOptions.customDomain || 'plausible.io';
- var scriptURI = plausibleDomain === 'plausible.io' ? '/js/plausible.js' : '/js/index.js';
Expand All @@ -13,12 +13,13 @@ index c00d563..785cddd 100755
var domain = pluginOptions.domain;
var excludePaths = pluginOptions.excludePaths || [];
var trackAcquisition = pluginOptions.trackAcquisition || false;
@@ -44,7 +44,7 @@ exports.onRenderBody = function (_ref, pluginOptions) {
@@ -44,7 +44,8 @@ exports.onRenderBody = function (_ref, pluginOptions) {
async: true,
defer: true,
'data-domain': domain,
- src: "https://" + plausibleDomain + scriptURI
+ 'data-api': '/proxy/api/event',
+ src: scriptURI
};

if (trackAcquisition) {
if (trackAcquisition) {
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9028,7 +9028,7 @@ gatsby-plugin-page-creator@^4.22.0:

gatsby-plugin-plausible@^0.0.7:
version "0.0.7"
resolved "https://registry.npmjs.org/gatsby-plugin-plausible/-/gatsby-plugin-plausible-0.0.7.tgz#6f8c922bbc672a73bd8e9a39add61fb62ec96566"
resolved "https://registry.yarnpkg.com/gatsby-plugin-plausible/-/gatsby-plugin-plausible-0.0.7.tgz#6f8c922bbc672a73bd8e9a39add61fb62ec96566"
integrity sha512-pWCXsrWal8lWMmZ1wJ2dolbwZZR1CZU1LVR/K1rYC8NeA+uqTLY8h3uH3hFgP5n8jmRRenOSJ9SjWM9OIdCjOA==
dependencies:
"@babel/runtime" "^7.9.2"
Expand Down

0 comments on commit 5e44d46

Please sign in to comment.