diff --git a/.babelrc b/.babelrc index 0b7ff71abe..69e76253c9 100644 --- a/.babelrc +++ b/.babelrc @@ -19,6 +19,8 @@ } ], "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-optional-chaining", + "@babel/plugin-proposal-nullish-coalescing-operator", [ "relay", { diff --git a/package.json b/package.json index 68e35db19d..335ffa2b80 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "peerDependencies": { "@artsy/palette": "^4.16.0 || ^5.0.0 || ^7.0.0", "@sentry/browser": "^4.2.3", + "express-http-context": "^1.2.3", "flickity": "2.1.2", "react": "^16.8.0", "react-dom": "^16.8.0", @@ -57,6 +58,8 @@ "@babel/plugin-proposal-class-properties": "7.3.4", "@babel/plugin-proposal-decorators": "7.3.0", "@babel/plugin-proposal-json-strings": "7.2.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-proposal-optional-chaining": "^7.8.3", "@babel/plugin-syntax-dynamic-import": "7.8.3", "@babel/plugin-syntax-import-meta": "7.0.0", "@babel/preset-env": "7.3.4", @@ -115,6 +118,7 @@ "dotenv": "4.0.0", "enzyme": "3.8.0", "enzyme-adapter-react-16": "1.7.1", + "express-http-context": "^1.2.3", "flickity": "2.1.2", "fork-ts-checker-notifier-webpack-plugin": "0.6.2", "fork-ts-checker-webpack-plugin": "0.4.10", diff --git a/src/Apps/Artwork/ArtworkApp.tsx b/src/Apps/Artwork/ArtworkApp.tsx index c491059b4f..23a7c77cab 100644 --- a/src/Apps/Artwork/ArtworkApp.tsx +++ b/src/Apps/Artwork/ArtworkApp.tsx @@ -31,6 +31,7 @@ export interface Props { artwork: ArtworkApp_artwork tracking?: TrackingProp routerPathname: string + referrer: string } declare const window: any @@ -53,6 +54,7 @@ export class ArtworkApp extends React.Component { trackPageview() { const { artwork: { listPrice, availability, is_offerable, is_acquireable }, + referrer, } = this.props // FIXME: This breaks our global pageview tracking in the router level. @@ -64,6 +66,7 @@ export class ArtworkApp extends React.Component { offerable: is_offerable, availability, price_listed: !!listPrice, + referrer, } if (typeof window.analytics !== "undefined") { @@ -222,7 +225,14 @@ export class ArtworkApp extends React.Component { -