Skip to content

Commit

Permalink
fix: missing body for fetch intercepts in ga events forwarder
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpagtakhan committed Nov 25, 2024
1 parent 55e24be commit f951936
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-autocapture-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"publish": "node ../../scripts/publish/upload-to-s3.js",
"test": "jest",
"typecheck": "tsc -p ./tsconfig.json",
"version": "yarn version-file && yarn add @amplitude/analytics-client-common@\">=1 <3\"",
"version": "yarn version-file && yarn add @amplitude/analytics-client-common@\">=1 <3\" && yarn build",
"version-file": "node -p \"'export const VERSION = \\'' + require('./package.json').version + '\\';'\" > src/version.ts"
},
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-ga-events-forwarder-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"publish": "node ../../scripts/publish/upload-to-s3.js",
"test": "jest",
"typecheck": "tsc -p ./tsconfig.json",
"version": "yarn version-file && yarn add @amplitude/analytics-types@\">=1 <3\" @amplitude/analytics-client-common@\">=1 <3\"",
"version": "yarn version-file && yarn add @amplitude/analytics-types@\">=1 <3\" @amplitude/analytics-client-common@\">=1 <3\" && yarn build",
"version-file": "node -p \"'export const VERSION = \\'' + require('./package.json').version + '\\';'\" > src/version.ts"
},
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const gaEventsForwarderPlugin = ({ measurementIds = [] }: Options = {}):
return intercept(requestUrl, data);
};

const interceptFetch: FetchInterceptor = (resource, _options) => {
const interceptFetch: FetchInterceptor = (resource, options) => {
let requestUrl: string | URL = '';

// Fetch accepts strings, objects with stringifiers, or request objects
Expand All @@ -120,7 +120,7 @@ export const gaEventsForwarderPlugin = ({ measurementIds = [] }: Options = {}):
logger?.error(e);
}

intercept(requestUrl, null);
intercept(requestUrl, options?.body);
};

/**
Expand Down

0 comments on commit f951936

Please sign in to comment.