@jetshop/core 5.17.0-alpha.8ede57ab → 5.17.0-alpha.8f38c56f
Sign up to get free protection for your applications and to get access to all the features.
- package/ChannelHandler/ChannelHandler.d.ts +53 -0
- package/ChannelHandler/ChannelHandler.js +114 -0
- package/ChannelHandler/ChannelHandler.js.map +1 -0
- package/ChannelHandler/channelUtils.d.ts +73 -0
- package/ChannelHandler/channelUtils.js +313 -0
- package/ChannelHandler/channelUtils.js.map +1 -0
- package/ChannelHandler/redirectUtils.d.ts +4 -0
- package/ChannelHandler/redirectUtils.js +50 -0
- package/ChannelHandler/redirectUtils.js.map +1 -0
- package/ChannelHandler/redirectUtils.test.js +5 -5
- package/ChannelHandler/redirectUtilsGroupedChannels.test.js +5 -5
- package/analytics/Analytics.d.ts +18 -0
- package/analytics/Analytics.js +57 -0
- package/analytics/Analytics.js.map +1 -0
- package/analytics/AnalyticsProvider.d.ts +54 -0
- package/analytics/AnalyticsProvider.js +229 -0
- package/analytics/AnalyticsProvider.js.map +1 -0
- package/analytics/deprecatedTracking.d.ts +17 -0
- package/analytics/deprecatedTracking.js +33 -0
- package/analytics/deprecatedTracking.js.map +1 -0
- package/analytics/integrations/ga4.d.ts +28 -0
- package/analytics/integrations/ga4.js +189 -0
- package/analytics/integrations/ga4.js.map +1 -0
- package/analytics/integrations/gtag/gtag.d.ts +8 -0
- package/analytics/integrations/gtag/gtag.js +209 -0
- package/analytics/integrations/gtag/gtag.js.map +1 -0
- package/analytics/integrations/gtag/index.d.ts +1 -0
- package/analytics/integrations/gtag/index.js +2 -0
- package/analytics/integrations/gtag/index.js.map +1 -0
- package/analytics/integrations/gtm/gtm.d.ts +12 -0
- package/analytics/integrations/gtm/gtm.js +227 -0
- package/analytics/integrations/gtm/gtm.js.map +1 -0
- package/analytics/integrations/gtm/index.d.ts +1 -0
- package/analytics/integrations/gtm/index.js +2 -0
- package/analytics/integrations/gtm/index.js.map +1 -0
- package/analytics/integrations/gtm/referrerModifier.d.ts +1 -0
- package/analytics/integrations/gtm/referrerModifier.js +62 -0
- package/analytics/integrations/gtm/referrerModifier.js.map +1 -0
- package/analytics/integrations/releware/index.d.ts +3 -0
- package/analytics/integrations/releware/index.js +39 -0
- package/analytics/integrations/releware/index.js.map +1 -0
- package/analytics/integrations/unslugify.d.ts +1 -0
- package/analytics/integrations/unslugify.js +16 -0
- package/analytics/integrations/unslugify.js.map +1 -0
- package/analytics/trackerRegistry.d.ts +113 -0
- package/analytics/trackerRegistry.js +222 -0
- package/analytics/trackerRegistry.js.map +1 -0
- package/analytics/tracking.d.ts +14 -0
- package/analytics/tracking.js +72 -0
- package/analytics/tracking.js.map +1 -0
- package/analytics/utils/breadcrumbsWithoutProduct.d.ts +1 -0
- package/analytics/utils/breadcrumbsWithoutProduct.js +9 -0
- package/analytics/utils/breadcrumbsWithoutProduct.js.map +1 -0
- package/analytics/utils/script.d.ts +8 -0
- package/analytics/utils/script.js +40 -0
- package/analytics/utils/script.js.map +1 -0
- package/analytics/webVitals.d.ts +5 -0
- package/analytics/webVitals.js +39 -0
- package/analytics/webVitals.js.map +1 -0
- package/boot/AuthHandler.d.ts +14 -0
- package/boot/AuthHandler.js +39 -0
- package/boot/AuthHandler.js.map +1 -0
- package/boot/NetworkStatusNotifier.d.ts +2 -0
- package/boot/NetworkStatusNotifier.js +4 -0
- package/boot/NetworkStatusNotifier.js.map +1 -0
- package/boot/PreviewHandler.d.ts +7 -0
- package/boot/PreviewHandler.js +14 -0
- package/boot/PreviewHandler.js.map +1 -0
- package/boot/SharedTree.d.ts +25 -0
- package/boot/SharedTree.js +29 -0
- package/boot/SharedTree.js.map +1 -0
- package/boot/addMissingConfig.d.ts +5 -0
- package/boot/addMissingConfig.js +34 -0
- package/boot/addMissingConfig.js.map +1 -0
- package/boot/apollo.d.ts +20 -0
- package/boot/apollo.js +202 -0
- package/boot/apollo.js.map +1 -0
- package/boot/client/entrypoint.d.ts +1 -0
- package/boot/client/entrypoint.js +5 -0
- package/boot/client/entrypoint.js.map +1 -0
- package/boot/client/index.d.ts +1 -0
- package/boot/client/index.js +2 -0
- package/boot/client/index.js.map +1 -0
- package/boot/client/startClient.d.ts +4 -0
- package/boot/client/startClient.js +153 -0
- package/boot/client/startClient.js.map +1 -0
- package/boot/server/IntervalQuery.d.ts +32 -0
- package/boot/server/IntervalQuery.js +95 -0
- package/boot/server/IntervalQuery.js.map +1 -0
- package/boot/server/IntervalQuery.test.js +9 -13
- package/boot/server/PersistedApolloClient.d.ts +20 -0
- package/boot/server/PersistedApolloClient.js +40 -0
- package/boot/server/PersistedApolloClient.js.map +1 -0
- package/boot/server/PersistedApolloClient.test.js +8 -7
- package/boot/server/asyncErrorHandler.d.ts +3 -0
- package/boot/server/asyncErrorHandler.js +5 -0
- package/boot/server/asyncErrorHandler.js.map +1 -0
- package/boot/server/breakpointMiddleware.d.ts +3 -0
- package/boot/server/breakpointMiddleware.js +10 -0
- package/boot/server/breakpointMiddleware.js.map +1 -0
- package/boot/server/createApolloServer.d.ts +29 -0
- package/boot/server/createApolloServer.js +144 -0
- package/boot/server/createApolloServer.js.map +1 -0
- package/boot/server/createDevServer.d.ts +14 -0
- package/boot/server/createDevServer.js +30 -0
- package/boot/server/createDevServer.js.map +1 -0
- package/boot/server/createRenderer.d.ts +28 -0
- package/boot/server/createRenderer.js +239 -0
- package/boot/server/createRenderer.js.map +1 -0
- package/boot/server/createServer.d.ts +14 -0
- package/boot/server/createServer.js +42 -0
- package/boot/server/createServer.js.map +1 -0
- package/boot/server/entrypoint.d.ts +1 -0
- package/boot/server/entrypoint.js +39 -0
- package/boot/server/entrypoint.js.map +1 -0
- package/boot/server/getPrefetchFiles.d.ts +10 -0
- package/boot/server/getPrefetchFiles.js +20 -0
- package/boot/server/getPrefetchFiles.js.map +1 -0
- package/boot/server/getPreloadAssets.d.ts +10 -0
- package/boot/server/getPreloadAssets.js +18 -0
- package/boot/server/getPreloadAssets.js.map +1 -0
- package/boot/server/index.d.ts +9 -0
- package/boot/server/index.js +123 -0
- package/boot/server/index.js.map +1 -0
- package/boot/server/listen.d.ts +13 -0
- package/boot/server/listen.js +17 -0
- package/boot/server/listen.js.map +1 -0
- package/boot/server/persistedQueries/PersistedClient.d.ts +22 -0
- package/boot/server/persistedQueries/PersistedClient.js +58 -0
- package/boot/server/persistedQueries/PersistedClient.js.map +1 -0
- package/boot/server/persistedQueries/__tests__/getPersistedQueriesForRequest.test.js +1 -1
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.d.ts +3 -0
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.js +27 -0
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.js.map +1 -0
- package/boot/server/salesSource.d.ts +8 -0
- package/boot/server/salesSource.js +16 -0
- package/boot/server/salesSource.js.map +1 -0
- package/boot/utils/createIntOptions.d.ts +6 -0
- package/boot/utils/createIntOptions.js +19 -0
- package/boot/utils/createIntOptions.js.map +1 -0
- package/boot/utils/queryLoggingMiddleware.d.ts +2 -0
- package/boot/utils/queryLoggingMiddleware.js +15 -0
- package/boot/utils/queryLoggingMiddleware.js.map +1 -0
- package/boot/utils/uid.d.ts +3 -0
- package/boot/utils/uid.js +20 -0
- package/boot/utils/uid.js.map +1 -0
- package/cart/AddToCartFormik.d.ts +42 -0
- package/cart/AddToCartFormik.js +77 -0
- package/cart/AddToCartFormik.js.map +1 -0
- package/cart/useAddToCart.d.ts +88 -0
- package/cart/useAddToCart.js +119 -0
- package/cart/useAddToCart.js.map +1 -0
- package/cart/useCart.d.ts +0 -0
- package/cart/useCart.js +1 -0
- package/cart/useCart.js.map +1 -0
- package/components/Auth/CustomerFormContainer.d.ts +0 -0
- package/components/Auth/CustomerFormContainer.js +1 -0
- package/components/Auth/CustomerFormContainer.js.map +1 -0
- package/components/Auth/CustomerUpdateForm.d.ts +32 -0
- package/components/Auth/CustomerUpdateForm.js +122 -0
- package/components/Auth/CustomerUpdateForm.js.map +1 -0
- package/components/Auth/ForgotPasswordProvider.d.ts +69 -0
- package/components/Auth/ForgotPasswordProvider.js +57 -0
- package/components/Auth/ForgotPasswordProvider.js.map +1 -0
- package/components/Auth/ResetPasswordProvider.d.ts +90 -0
- package/components/Auth/ResetPasswordProvider.js +78 -0
- package/components/Auth/ResetPasswordProvider.js.map +1 -0
- package/components/Auth/SSN.d.ts +12 -0
- package/components/Auth/SSN.js +35 -0
- package/components/Auth/SSN.js.map +1 -0
- package/components/Auth/SSNLookupContainer.d.ts +15 -0
- package/components/Auth/SSNLookupContainer.js +20 -0
- package/components/Auth/SSNLookupContainer.js.map +1 -0
- package/components/Auth/SignupFormContainer.d.ts +16 -0
- package/components/Auth/SignupFormContainer.js +82 -0
- package/components/Auth/SignupFormContainer.js.map +1 -0
- package/components/Auth/UpdatePasswordForm.d.ts +44 -0
- package/components/Auth/UpdatePasswordForm.js +98 -0
- package/components/Auth/UpdatePasswordForm.js.map +1 -0
- package/components/Auth/formFieldsFromSettings.d.ts +65 -0
- package/components/Auth/formFieldsFromSettings.js +77 -0
- package/components/Auth/formFieldsFromSettings.js.map +1 -0
- package/components/Auth/formatSignupInput.d.ts +8 -0
- package/components/Auth/formatSignupInput.js +43 -0
- package/components/Auth/formatSignupInput.js.map +1 -0
- package/components/Auth/signup-context.d.ts +36 -0
- package/components/Auth/signup-context.js +71 -0
- package/components/Auth/signup-context.js.map +1 -0
- package/components/Auth/signup-field-translations.d.ts +3 -0
- package/components/Auth/signup-field-translations.js +44 -0
- package/components/Auth/signup-field-translations.js.map +1 -0
- package/components/Auth/signupSubmit.d.ts +6 -0
- package/components/Auth/signupSubmit.js +57 -0
- package/components/Auth/signupSubmit.js.map +1 -0
- package/components/Auth/useAddressFields.d.ts +22 -0
- package/components/Auth/useAddressFields.js +33 -0
- package/components/Auth/useAddressFields.js.map +1 -0
- package/components/Auth/useAddressFields.test.js +10 -8
- package/components/Auth/useCustomer.d.ts +116 -0
- package/components/Auth/useCustomer.js +189 -0
- package/components/Auth/useCustomer.js.map +1 -0
- package/components/Auth/useLoginFields.d.ts +20 -0
- package/components/Auth/useLoginFields.js +21 -0
- package/components/Auth/useLoginFields.js.map +1 -0
- package/components/Auth/useSignupForm.d.ts +7 -0
- package/components/Auth/useSignupForm.js +15 -0
- package/components/Auth/useSignupForm.js.map +1 -0
- package/components/AuthContext/AuthContext.d.ts +8 -0
- package/components/AuthContext/AuthContext.js +9 -0
- package/components/AuthContext/AuthContext.js.map +1 -0
- package/components/AuthContext/AuthProvider.d.ts +6 -0
- package/components/AuthContext/AuthProvider.js +85 -0
- package/components/AuthContext/AuthProvider.js.map +1 -0
- package/components/AuthContext/AuthProvider.test.js +1 -1
- package/components/AuthContext/LogOut.d.ts +5 -0
- package/components/AuthContext/LogOut.js +15 -0
- package/components/AuthContext/LogOut.js.map +1 -0
- package/components/AuthContext/useAuth.d.ts +6 -0
- package/components/AuthContext/useAuth.js +21 -0
- package/components/AuthContext/useAuth.js.map +1 -0
- package/components/BreakpointProvider.d.ts +21 -0
- package/components/BreakpointProvider.js +24 -0
- package/components/BreakpointProvider.js.map +1 -0
- package/components/Cart/CartIdContext.d.ts +11 -0
- package/components/Cart/CartIdContext.js +61 -0
- package/components/Cart/CartIdContext.js.map +1 -0
- package/components/ChannelContext/ChannelContext.d.ts +21 -0
- package/components/ChannelContext/ChannelContext.js +4 -0
- package/components/ChannelContext/ChannelContext.js.map +1 -0
- package/components/ChannelContext/ChannelProvider.d.ts +10 -0
- package/components/ChannelContext/ChannelProvider.js +45 -0
- package/components/ChannelContext/ChannelProvider.js.map +1 -0
- package/components/ChannelContext/index.d.ts +2 -0
- package/components/ChannelContext/index.js +3 -0
- package/components/ChannelContext/index.js.map +1 -0
- package/components/ChannelContext/useCountrySettings.d.ts +8 -0
- package/components/ChannelContext/useCountrySettings.js +24 -0
- package/components/ChannelContext/useCountrySettings.js.map +1 -0
- package/components/ConfigProvider.d.ts +108 -0
- package/components/ConfigProvider.js +20 -0
- package/components/ConfigProvider.js.map +1 -0
- package/components/DynamicRoute/ActiveFiltersQuery.gql +4 -4
- package/components/DynamicRoute/CategoryRoute.d.ts +13 -0
- package/components/DynamicRoute/CategoryRoute.js +59 -0
- package/components/DynamicRoute/CategoryRoute.js.map +1 -0
- package/components/DynamicRoute/ContentRoute.d.ts +14 -0
- package/components/DynamicRoute/ContentRoute.js +28 -0
- package/components/DynamicRoute/ContentRoute.js.map +1 -0
- package/components/DynamicRoute/CustomerRoute.d.ts +0 -0
- package/components/DynamicRoute/CustomerRoute.js +1 -0
- package/components/DynamicRoute/CustomerRoute.js.map +1 -0
- package/components/DynamicRoute/GenericError.d.ts +18 -0
- package/components/DynamicRoute/GenericError.js +61 -0
- package/components/DynamicRoute/GenericError.js.map +1 -0
- package/components/DynamicRoute/PreviewRoute.d.ts +17 -0
- package/components/DynamicRoute/PreviewRoute.js +58 -0
- package/components/DynamicRoute/PreviewRoute.js.map +1 -0
- package/components/DynamicRoute/ProductByArticlenumber.d.ts +5 -0
- package/components/DynamicRoute/ProductByArticlenumber.js +22 -0
- package/components/DynamicRoute/ProductByArticlenumber.js.map +1 -0
- package/components/DynamicRoute/ProductRoute.d.ts +15 -0
- package/components/DynamicRoute/ProductRoute.js +65 -0
- package/components/DynamicRoute/ProductRoute.js.map +1 -0
- package/components/DynamicRoute/RouteResolver.d.ts +22 -0
- package/components/DynamicRoute/RouteResolver.js +65 -0
- package/components/DynamicRoute/RouteResolver.js.map +1 -0
- package/components/DynamicRoute/Status.d.ts +15 -0
- package/components/DynamicRoute/Status.js +20 -0
- package/components/DynamicRoute/Status.js.map +1 -0
- package/components/DynamicRoute/index.d.ts +17 -0
- package/components/DynamicRoute/index.js +100 -0
- package/components/DynamicRoute/index.js.map +1 -0
- package/components/Filters/index.d.ts +1 -0
- package/components/Filters/index.js +2 -0
- package/components/Filters/index.js.map +1 -0
- package/components/Filters/utils/replaceInSearch.d.ts +14 -0
- package/components/Filters/utils/replaceInSearch.js +23 -0
- package/components/Filters/utils/replaceInSearch.js.map +1 -0
- package/components/Filters/utils/updateHistory.d.ts +25 -0
- package/components/Filters/utils/updateHistory.js +30 -0
- package/components/Filters/utils/updateHistory.js.map +1 -0
- package/components/Fonts/CustomFont.d.ts +14 -0
- package/components/Fonts/CustomFont.js +17 -0
- package/components/Fonts/CustomFont.js.map +1 -0
- package/components/Fonts/injectFont.d.ts +11 -0
- package/components/Fonts/injectFont.js +30 -0
- package/components/Fonts/injectFont.js.map +1 -0
- package/components/Head.d.ts +11 -0
- package/components/Head.js +84 -0
- package/components/Head.js.map +1 -0
- package/components/Mutation/AddToCart/addToCartUtils.d.ts +18 -0
- package/components/Mutation/AddToCart/addToCartUtils.js +52 -0
- package/components/Mutation/AddToCart/addToCartUtils.js.map +1 -0
- package/components/Mutation/AddToCartFormik.d.ts +53 -0
- package/components/Mutation/AddToCartFormik.js +173 -0
- package/components/Mutation/AddToCartFormik.js.map +1 -0
- package/components/Mutation/DecrementQuantity.d.ts +4 -0
- package/components/Mutation/DecrementQuantity.js +35 -0
- package/components/Mutation/DecrementQuantity.js.map +1 -0
- package/components/Mutation/IncrementQuantity.d.ts +4 -0
- package/components/Mutation/IncrementQuantity.js +35 -0
- package/components/Mutation/IncrementQuantity.js.map +1 -0
- package/components/Mutation/RemoveFromCart.d.ts +5 -0
- package/components/Mutation/RemoveFromCart.js +52 -0
- package/components/Mutation/RemoveFromCart.js.map +1 -0
- package/components/Mutation/SetQuantity.d.ts +4 -0
- package/components/Mutation/SetQuantity.js +37 -0
- package/components/Mutation/SetQuantity.js.map +1 -0
- package/components/Mutation/SubscribeToNewsletter.d.ts +4 -0
- package/components/Mutation/SubscribeToNewsletter.js +30 -0
- package/components/Mutation/SubscribeToNewsletter.js.map +1 -0
- package/components/Mutation/SubscribeToStockNotifications.d.ts +4 -0
- package/components/Mutation/SubscribeToStockNotifications.js +35 -0
- package/components/Mutation/SubscribeToStockNotifications.js.map +1 -0
- package/components/Mutation/cartMutationUtils.d.ts +27 -0
- package/components/Mutation/cartMutationUtils.js +109 -0
- package/components/Mutation/cartMutationUtils.js.map +1 -0
- package/components/Mutation/useDecrementQuantity.d.ts +11 -0
- package/components/Mutation/useDecrementQuantity.js +54 -0
- package/components/Mutation/useDecrementQuantity.js.map +1 -0
- package/components/Mutation/useIncrementQuantity.d.ts +11 -0
- package/components/Mutation/useIncrementQuantity.js +54 -0
- package/components/Mutation/useIncrementQuantity.js.map +1 -0
- package/components/Mutation/useRemoveFromCart.d.ts +13 -0
- package/components/Mutation/useRemoveFromCart.js +50 -0
- package/components/Mutation/useRemoveFromCart.js.map +1 -0
- package/components/Mutation/useSetQuantity.d.ts +12 -0
- package/components/Mutation/useSetQuantity.js +38 -0
- package/components/Mutation/useSetQuantity.js.map +1 -0
- package/components/Notifications/Notifications.d.ts +15 -0
- package/components/Notifications/Notifications.js +26 -0
- package/components/Notifications/Notifications.js.map +1 -0
- package/components/Notifications/index.d.ts +2 -0
- package/components/Notifications/index.js +3 -0
- package/components/Notifications/index.js.map +1 -0
- package/components/Notifications/notificationMachine.d.ts +30 -0
- package/components/Notifications/notificationMachine.js +74 -0
- package/components/Notifications/notificationMachine.js.map +1 -0
- package/components/Notifications/notificationsMachine.d.ts +37 -0
- package/components/Notifications/notificationsMachine.js +66 -0
- package/components/Notifications/notificationsMachine.js.map +1 -0
- package/components/Notifications/useNotification.d.ts +9 -0
- package/components/Notifications/useNotification.js +27 -0
- package/components/Notifications/useNotification.js.map +1 -0
- package/components/OpenGraph/OpenGraphGeneralPageData.d.ts +25 -0
- package/components/OpenGraph/OpenGraphGeneralPageData.js +37 -0
- package/components/OpenGraph/OpenGraphGeneralPageData.js.map +1 -0
- package/components/OpenGraph/OpenGraphProductData.d.ts +25 -0
- package/components/OpenGraph/OpenGraphProductData.js +49 -0
- package/components/OpenGraph/OpenGraphProductData.js.map +1 -0
- package/components/OpenGraph/index.d.ts +2 -0
- package/components/OpenGraph/index.js +3 -0
- package/components/OpenGraph/index.js.map +1 -0
- package/components/Pagination/PaginationContainer.d.ts +2 -0
- package/components/Pagination/PaginationContainer.js +5 -0
- package/components/Pagination/PaginationContainer.js.map +1 -0
- package/components/Pagination/PaginationContext.d.ts +14 -0
- package/components/Pagination/PaginationContext.js +4 -0
- package/components/Pagination/PaginationContext.js.map +1 -0
- package/components/Pagination/PaginationProvider.d.ts +19 -0
- package/components/Pagination/PaginationProvider.js +95 -0
- package/components/Pagination/PaginationProvider.js.map +1 -0
- package/components/PreviewContext.d.ts +10 -0
- package/components/PreviewContext.js +27 -0
- package/components/PreviewContext.js.map +1 -0
- package/components/ProductConfigurationProvider/ProductConfigurationContext.d.ts +13 -0
- package/components/ProductConfigurationProvider/ProductConfigurationContext.js +5 -0
- package/components/ProductConfigurationProvider/ProductConfigurationContext.js.map +1 -0
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.d.ts +6 -0
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.js +50 -0
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.js.map +1 -0
- package/components/Query/CartProvider.d.ts +22 -0
- package/components/Query/CartProvider.js +68 -0
- package/components/Query/CartProvider.js.map +1 -0
- package/components/SortOrder/SortOrderContainer.d.ts +40 -0
- package/components/SortOrder/SortOrderContainer.js +108 -0
- package/components/SortOrder/SortOrderContainer.js.map +1 -0
- package/components/SortOrder/SortOrderContext.d.ts +9 -0
- package/components/SortOrder/SortOrderContext.js +9 -0
- package/components/SortOrder/SortOrderContext.js.map +1 -0
- package/components/StructuredData/SiteLinksSearchStructuredData.d.ts +3 -0
- package/components/StructuredData/SiteLinksSearchStructuredData.js +25 -0
- package/components/StructuredData/SiteLinksSearchStructuredData.js.map +1 -0
- package/components/StructuredData/StructuredBreadcrumbData.d.ts +12 -0
- package/components/StructuredData/StructuredBreadcrumbData.js +55 -0
- package/components/StructuredData/StructuredBreadcrumbData.js.map +1 -0
- package/components/StructuredData/StructuredCategoryData.d.ts +16 -0
- package/components/StructuredData/StructuredCategoryData.js +18 -0
- package/components/StructuredData/StructuredCategoryData.js.map +1 -0
- package/components/StructuredData/StructuredData.d.ts +9 -0
- package/components/StructuredData/StructuredData.js +7 -0
- package/components/StructuredData/StructuredData.js.map +1 -0
- package/components/StructuredData/StructuredPageData.d.ts +16 -0
- package/components/StructuredData/StructuredPageData.js +17 -0
- package/components/StructuredData/StructuredPageData.js.map +1 -0
- package/components/StructuredData/StructuredProductData.d.ts +18 -0
- package/components/StructuredData/StructuredProductData.js +43 -0
- package/components/StructuredData/StructuredProductData.js.map +1 -0
- package/components/StructuredData/index.d.ts +5 -0
- package/components/StructuredData/index.js +6 -0
- package/components/StructuredData/index.js.map +1 -0
- package/data/cache.d.ts +3 -0
- package/data/cache.js +34 -0
- package/data/cache.js.map +1 -0
- package/data/fragmentTypes.d.ts +8 -0
- package/data/fragmentTypes.js +84 -0
- package/data/fragmentTypes.js.map +1 -0
- package/data/fragments/index.d.ts +1 -0
- package/data/fragments/index.js +2 -0
- package/data/fragments/index.js.map +1 -0
- package/errorReporting.browser.d.ts +3 -0
- package/errorReporting.browser.js +12 -0
- package/errorReporting.browser.js.map +1 -0
- package/errorReporting.d.ts +3 -0
- package/errorReporting.js +20 -0
- package/errorReporting.js.map +1 -0
- package/errorReporting.server.d.ts +3 -0
- package/errorReporting.server.js +12 -0
- package/errorReporting.server.js.map +1 -0
- package/errorReporting.shared.d.ts +5 -0
- package/errorReporting.shared.js +17 -0
- package/errorReporting.shared.js.map +1 -0
- package/experiments/ExperimentsProvider.d.ts +4 -0
- package/experiments/ExperimentsProvider.js +29 -0
- package/experiments/ExperimentsProvider.js.map +1 -0
- package/experiments/selectExperimentVariant.d.ts +3 -0
- package/experiments/selectExperimentVariant.js +35 -0
- package/experiments/selectExperimentVariant.js.map +1 -0
- package/experiments/useExperiment.d.ts +2 -0
- package/experiments/useExperiment.js +11 -0
- package/experiments/useExperiment.js.map +1 -0
- package/global.d.ts +55 -1
- package/helpers/decodeUrlQuery.d.ts +9 -0
- package/helpers/decodeUrlQuery.js +27 -0
- package/helpers/decodeUrlQuery.js.map +1 -0
- package/helpers/distance.d.ts +7 -0
- package/helpers/distance.js +13 -0
- package/helpers/distance.js.map +1 -0
- package/helpers/encodeVariant.d.ts +3 -0
- package/helpers/encodeVariant.js +25 -0
- package/helpers/encodeVariant.js.map +1 -0
- package/helpers/getBreakpointsFromValues.d.ts +6 -0
- package/helpers/getBreakpointsFromValues.js +15 -0
- package/helpers/getBreakpointsFromValues.js.map +1 -0
- package/helpers/getCartItemVariant.d.ts +7 -0
- package/helpers/getCartItemVariant.js +9 -0
- package/helpers/getCartItemVariant.js.map +1 -0
- package/helpers/getErrorDetail.d.ts +7 -0
- package/helpers/getErrorDetail.js +12 -0
- package/helpers/getErrorDetail.js.map +1 -0
- package/helpers/getHeaders.d.ts +6 -0
- package/helpers/getHeaders.js +4 -0
- package/helpers/getHeaders.js.map +1 -0
- package/helpers/isRelativeUrl.d.ts +1 -0
- package/helpers/isRelativeUrl.js +4 -0
- package/helpers/isRelativeUrl.js.map +1 -0
- package/helpers/logError.d.ts +1 -0
- package/helpers/logError.js +17 -0
- package/helpers/logError.js.map +1 -0
- package/helpers/logWarningInDev.d.ts +1 -0
- package/helpers/logWarningInDev.js +7 -0
- package/helpers/logWarningInDev.js.map +1 -0
- package/helpers/throwErrorInDev.d.ts +6 -0
- package/helpers/throwErrorInDev.js +15 -0
- package/helpers/throwErrorInDev.js.map +1 -0
- package/helpers/uniqueId.d.ts +5 -0
- package/helpers/uniqueId.js +10 -0
- package/helpers/uniqueId.js.map +1 -0
- package/hooks/Channels/useChannelSettings.d.ts +7 -0
- package/hooks/Channels/useChannelSettings.js +12 -0
- package/hooks/Channels/useChannelSettings.js.map +1 -0
- package/hooks/Filters/useBooleanFilter.d.ts +8 -0
- package/hooks/Filters/useBooleanFilter.js +20 -0
- package/hooks/Filters/useBooleanFilter.js.map +1 -0
- package/hooks/Filters/useFilters.d.ts +3 -0
- package/hooks/Filters/useFilters.js +15 -0
- package/hooks/Filters/useFilters.js.map +1 -0
- package/hooks/Filters/useListFilter.d.ts +10 -0
- package/hooks/Filters/useListFilter.js +37 -0
- package/hooks/Filters/useListFilter.js.map +1 -0
- package/hooks/Filters/useMultiFilter.d.ts +13 -0
- package/hooks/Filters/useMultiFilter.js +49 -0
- package/hooks/Filters/useMultiFilter.js.map +1 -0
- package/hooks/Filters/useRangeFilter.d.ts +10 -0
- package/hooks/Filters/useRangeFilter.js +35 -0
- package/hooks/Filters/useRangeFilter.js.map +1 -0
- package/hooks/Filters/useSortOrder.d.ts +16 -0
- package/hooks/Filters/useSortOrder.js +23 -0
- package/hooks/Filters/useSortOrder.js.map +1 -0
- package/hooks/PackageProducts/index.d.ts +2 -0
- package/hooks/PackageProducts/index.js +3 -0
- package/hooks/PackageProducts/index.js.map +1 -0
- package/hooks/PackageProducts/usePackageProductItem.d.ts +17 -0
- package/hooks/PackageProducts/usePackageProductItem.js +27 -0
- package/hooks/PackageProducts/usePackageProductItem.js.map +1 -0
- package/hooks/PackageProducts/usePackageProducts.d.ts +19 -0
- package/hooks/PackageProducts/usePackageProducts.js +346 -0
- package/hooks/PackageProducts/usePackageProducts.js.map +1 -0
- package/hooks/PackageProducts/usePackageProducts.test.js +1 -1
- package/hooks/Product/index.d.ts +1 -0
- package/hooks/Product/index.js +2 -0
- package/hooks/Product/index.js.map +1 -0
- package/hooks/Product/useStockStatus.d.ts +9 -0
- package/hooks/Product/useStockStatus.js +26 -0
- package/hooks/Product/useStockStatus.js.map +1 -0
- package/hooks/Product/useSwitchToVariantImage.d.ts +9 -0
- package/hooks/Product/useSwitchToVariantImage.js +21 -0
- package/hooks/Product/useSwitchToVariantImage.js.map +1 -0
- package/hooks/ProductList/ProductListContext.d.ts +7 -0
- package/hooks/ProductList/ProductListContext.js +111 -0
- package/hooks/ProductList/ProductListContext.js.map +1 -0
- package/hooks/ProductList/action-creators.d.ts +46 -0
- package/hooks/ProductList/action-creators.js +297 -0
- package/hooks/ProductList/action-creators.js.map +1 -0
- package/hooks/ProductList/index.d.ts +118 -0
- package/hooks/ProductList/index.js +22 -0
- package/hooks/ProductList/index.js.map +1 -0
- package/hooks/ProductList/list-transforms.d.ts +75 -0
- package/hooks/ProductList/list-transforms.js +107 -0
- package/hooks/ProductList/list-transforms.js.map +1 -0
- package/hooks/ProductList/product-list-reducer.d.ts +76 -0
- package/hooks/ProductList/product-list-reducer.js +198 -0
- package/hooks/ProductList/product-list-reducer.js.map +1 -0
- package/hooks/ProductList/useProductList.d.ts +13 -0
- package/hooks/ProductList/useProductList.js +94 -0
- package/hooks/ProductList/useProductList.js.map +1 -0
- package/hooks/ProductList/useProductListItems.d.ts +10 -0
- package/hooks/ProductList/useProductListItems.js +49 -0
- package/hooks/ProductList/useProductListItems.js.map +1 -0
- package/hooks/ProductList/validate-product.d.ts +6 -0
- package/hooks/ProductList/validate-product.js +41 -0
- package/hooks/ProductList/validate-product.js.map +1 -0
- package/hooks/Subscriptions/useNewsletterSubscription.d.ts +38 -0
- package/hooks/Subscriptions/useNewsletterSubscription.js +42 -0
- package/hooks/Subscriptions/useNewsletterSubscription.js.map +1 -0
- package/hooks/Subscriptions/useStockNotifications.d.ts +36 -0
- package/hooks/Subscriptions/useStockNotifications.js +38 -0
- package/hooks/Subscriptions/useStockNotifications.js.map +1 -0
- package/hooks/Subscriptions/useStoreSubscriptions.d.ts +48 -0
- package/hooks/Subscriptions/useStoreSubscriptions.js +148 -0
- package/hooks/Subscriptions/useStoreSubscriptions.js.map +1 -0
- package/hooks/Subscriptions/useStoresubscriptions.test.js +5 -7
- package/hooks/useAddMultipleToCart.d.ts +27 -0
- package/hooks/useAddMultipleToCart.js +114 -0
- package/hooks/useAddMultipleToCart.js.map +1 -0
- package/hooks/useAddMultipleToCart.test.js +1 -1
- package/hooks/useChannels.d.ts +1 -0
- package/hooks/useChannels.js +10 -0
- package/hooks/useChannels.js.map +1 -0
- package/hooks/useCustomerOrders.test.js +7 -5
- package/hooks/useCustomerOrdersQuery.d.ts +21 -0
- package/hooks/useCustomerOrdersQuery.js +21 -0
- package/hooks/useCustomerOrdersQuery.js.map +1 -0
- package/hooks/useDeleteAccountMutation.d.ts +15 -0
- package/hooks/useDeleteAccountMutation.js +39 -0
- package/hooks/useDeleteAccountMutation.js.map +1 -0
- package/hooks/useDynamicPrice.d.ts +3 -0
- package/hooks/useDynamicPrice.js +25 -0
- package/hooks/useDynamicPrice.js.map +1 -0
- package/hooks/useFreeShippingCheck.d.ts +15 -0
- package/hooks/useFreeShippingCheck.js +31 -0
- package/hooks/useFreeShippingCheck.js.map +1 -0
- package/hooks/useGeolocation.d.ts +11 -0
- package/hooks/useGeolocation.js +34 -0
- package/hooks/useGeolocation.js.map +1 -0
- package/hooks/useInfinitePagination.d.ts +37 -0
- package/hooks/useInfinitePagination.js +142 -0
- package/hooks/useInfinitePagination.js.map +1 -0
- package/hooks/useLogError.d.ts +1 -0
- package/hooks/useLogError.js +8 -0
- package/hooks/useLogError.js.map +1 -0
- package/hooks/useLoginMutation.d.ts +12 -0
- package/hooks/useLoginMutation.js +15 -0
- package/hooks/useLoginMutation.js.map +1 -0
- package/hooks/useLoginRedirect.d.ts +4 -0
- package/hooks/useLoginRedirect.js +37 -0
- package/hooks/useLoginRedirect.js.map +1 -0
- package/hooks/useOrderDetailQuery.d.ts +20 -0
- package/hooks/useOrderDetailQuery.js +29 -0
- package/hooks/useOrderDetailQuery.js.map +1 -0
- package/hooks/usePreconnectLinks.d.ts +10 -0
- package/hooks/usePreconnectLinks.js +30 -0
- package/hooks/usePreconnectLinks.js.map +1 -0
- package/hooks/usePrice.d.ts +41 -0
- package/hooks/usePrice.js +73 -0
- package/hooks/usePrice.js.map +1 -0
- package/hooks/useProductVariants/index.d.ts +1 -0
- package/hooks/useProductVariants/index.js +2 -0
- package/hooks/useProductVariants/index.js.map +1 -0
- package/hooks/useProductVariants/useProductVariants.d.ts +19 -0
- package/hooks/useProductVariants/useProductVariants.js +203 -0
- package/hooks/useProductVariants/useProductVariants.js.map +1 -0
- package/hooks/useProductVariants/useVariantFromUrl.d.ts +5 -0
- package/hooks/useProductVariants/useVariantFromUrl.js +16 -0
- package/hooks/useProductVariants/useVariantFromUrl.js.map +1 -0
- package/hooks/useRoutePreload.d.ts +24 -0
- package/hooks/useRoutePreload.js +40 -0
- package/hooks/useRoutePreload.js.map +1 -0
- package/hooks/useShopConfig.d.ts +1 -0
- package/hooks/useShopConfig.js +11 -0
- package/hooks/useShopConfig.js.map +1 -0
- package/hooks/useStockStatus.d.ts +8 -0
- package/hooks/useStockStatus.js +26 -0
- package/hooks/useStockStatus.js.map +1 -0
- package/hooks/useThrowErrorInDev.d.ts +1 -0
- package/hooks/useThrowErrorInDev.js +8 -0
- package/hooks/useThrowErrorInDev.js.map +1 -0
- package/hooks/useThunkReducer.d.ts +7 -0
- package/hooks/useThunkReducer.js +24 -0
- package/hooks/useThunkReducer.js.map +1 -0
- package/hooks/useWarningInDev.d.ts +1 -0
- package/hooks/useWarningInDev.js +10 -0
- package/hooks/useWarningInDev.js.map +1 -0
- package/inServer.d.ts +1 -0
- package/inServer.js +3 -0
- package/inServer.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/index.js.map +1 -0
- package/integrations/addwishSchemaExtension.d.ts +35 -0
- package/integrations/addwishSchemaExtension.js +141 -0
- package/integrations/addwishSchemaExtension.js.map +1 -0
- package/integrations/nostoSchemaExtension.d.ts +5 -0
- package/integrations/nostoSchemaExtension.js +77 -0
- package/integrations/nostoSchemaExtension.js.map +1 -0
- package/integrations/sluggishSchemaExtension.d.ts +2 -0
- package/integrations/sluggishSchemaExtension.js +27 -0
- package/integrations/sluggishSchemaExtension.js.map +1 -0
- package/package.json +13 -29
- package/polyfills.d.ts +1 -0
- package/polyfills.js +36 -0
- package/polyfills.js.map +1 -0
- package/resolvers/filters/boolFilter.d.ts +3 -0
- package/resolvers/filters/boolFilter.js +82 -0
- package/resolvers/filters/boolFilter.js.map +1 -0
- package/resolvers/filters/defaultActiveFilters.d.ts +3 -0
- package/resolvers/filters/defaultActiveFilters.js +9 -0
- package/resolvers/filters/defaultActiveFilters.js.map +1 -0
- package/resolvers/filters/filterParams.d.ts +3 -0
- package/resolvers/filters/filterParams.js +85 -0
- package/resolvers/filters/filterParams.js.map +1 -0
- package/resolvers/filters/filters.d.ts +5 -0
- package/resolvers/filters/filters.js +79 -0
- package/resolvers/filters/filters.js.map +1 -0
- package/resolvers/filters/index.d.ts +23 -0
- package/resolvers/filters/index.js +8 -0
- package/resolvers/filters/index.js.map +1 -0
- package/resolvers/filters/listFilter.d.ts +7 -0
- package/resolvers/filters/listFilter.js +69 -0
- package/resolvers/filters/listFilter.js.map +1 -0
- package/resolvers/filters/listFilterItem.d.ts +3 -0
- package/resolvers/filters/listFilterItem.js +118 -0
- package/resolvers/filters/listFilterItem.js.map +1 -0
- package/resolvers/filters/multiListFilter.d.ts +5 -0
- package/resolvers/filters/multiListFilter.js +195 -0
- package/resolvers/filters/multiListFilter.js.map +1 -0
- package/resolvers/filters/multiListFilterList.d.ts +3 -0
- package/resolvers/filters/multiListFilterList.js +56 -0
- package/resolvers/filters/multiListFilterList.js.map +1 -0
- package/resolvers/filters/rangeFilter.d.ts +5 -0
- package/resolvers/filters/rangeFilter.js +122 -0
- package/resolvers/filters/rangeFilter.js.map +1 -0
- package/resolvers/filters/updateQueryString.d.ts +12 -0
- package/resolvers/filters/updateQueryString.js +117 -0
- package/resolvers/filters/updateQueryString.js.map +1 -0
- package/resolvers/index.d.ts +37 -0
- package/resolvers/index.js +38 -0
- package/resolvers/index.js.map +1 -0
- package/sentry/client.d.ts +1 -0
- package/sentry/client.js +30 -0
- package/sentry/client.js.map +1 -0
- package/sentry/common.d.ts +1 -0
- package/sentry/common.js +5 -0
- package/sentry/common.js.map +1 -0
- package/sentry/server.d.ts +1 -0
- package/sentry/server.js +20 -0
- package/sentry/server.js.map +1 -0
- package/sentry/utils.d.ts +1 -0
- package/sentry/utils.js +2 -0
- package/sentry/utils.js.map +1 -0
- package/server/graphql.d.ts +20 -0
- package/server/graphql.js +118 -0
- package/server/graphql.js.map +1 -0
- package/server/index.d.ts +2 -0
- package/server/index.js +3 -0
- package/server/index.js.map +1 -0
- package/server/tracking/facebook.d.ts +5 -0
- package/server/tracking/facebook.js +148 -0
- package/server/tracking/facebook.js.map +1 -0
- package/server/tracking/middleware.d.ts +8 -0
- package/server/tracking/middleware.js +15 -0
- package/server/tracking/middleware.js.map +1 -0
- package/test-utils/ProviderPyramid.js +1 -1
- package/time.d.ts +1 -0
- package/time.js +6 -0
- package/time.js.map +1 -0
- package/types.d.ts +1820 -1955
@@ -0,0 +1,189 @@
|
|
1
|
+
import { injectScript } from '../utils/script';
|
2
|
+
import { getBrand } from '../../../core/components/OpenGraph/OpenGraphProductData';
|
3
|
+
import { Cookies } from 'react-cookie';
|
4
|
+
import { CONSENT_COOKIE_NAME, defaultConsentSettings } from '../AnalyticsProvider';
|
5
|
+
const ga4 = () => window.gtag;
|
6
|
+
function productToItem(product, selectedVariation, useArticleNumberAsId = false, brandCustomField, category) {
|
7
|
+
var _a, _b, _c, _d;
|
8
|
+
const item_categories = category
|
9
|
+
.split('/')
|
10
|
+
.filter(Boolean)
|
11
|
+
.reduce((acc, c, i) => {
|
12
|
+
if (i === 0) {
|
13
|
+
acc.item_category = c;
|
14
|
+
}
|
15
|
+
else {
|
16
|
+
acc[`item_category${i + 1}`] = c;
|
17
|
+
}
|
18
|
+
return acc;
|
19
|
+
}, {});
|
20
|
+
return Object.assign({ item_name: product === null || product === void 0 ? void 0 : product.name, item_id: useArticleNumberAsId
|
21
|
+
? product === null || product === void 0 ? void 0 : product.articleNumber
|
22
|
+
: (_a = product === null || product === void 0 ? void 0 : product.id) === null || _a === void 0 ? void 0 : _a.toString(), price: ((_b = selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.price) === null || _b === void 0 ? void 0 : _b.incVat) || ((_c = product === null || product === void 0 ? void 0 : product.price) === null || _c === void 0 ? void 0 : _c.incVat), item_variant: (_d = selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.values) === null || _d === void 0 ? void 0 : _d.join('_'), item_brand: getBrand(product, brandCustomField) }, item_categories);
|
23
|
+
}
|
24
|
+
export function ga4Tracker({ trackingId, additionalGtagTrackingIds = [], currency, brandCustomField, useArticleNumberAsId = false, useGa4EventsFromGtm = false }) {
|
25
|
+
return {
|
26
|
+
name: 'ga4',
|
27
|
+
initBrowser({ config }) {
|
28
|
+
const w = window;
|
29
|
+
w.dataLayer = w.dataLayer || [];
|
30
|
+
w.dataLayer.push({
|
31
|
+
'gtm.start': new Date().getTime(),
|
32
|
+
event: 'gtm.js',
|
33
|
+
originalLocation: document.location.protocol +
|
34
|
+
'//' +
|
35
|
+
document.location.hostname +
|
36
|
+
document.location.pathname +
|
37
|
+
document.location.search
|
38
|
+
});
|
39
|
+
w.gtag = function gtag() {
|
40
|
+
w.dataLayer.push(arguments);
|
41
|
+
};
|
42
|
+
if (config.useTrackingConsentAPI) {
|
43
|
+
const consents = config.cookies.get(CONSENT_COOKIE_NAME) || defaultConsentSettings;
|
44
|
+
// NB: Only cookieless pings will be sent to Google servers. https://support.google.com/analytics/answer/9976101?hl=en
|
45
|
+
// There’s also a wait time of 500 milliseconds before any Google tags are allowed to fire,
|
46
|
+
// to give time for the update command to be invoked.
|
47
|
+
ga4()('consent', 'default', Object.assign({}, consents));
|
48
|
+
// NB: This only works when you set ad_storage to denied.
|
49
|
+
// https://developers.google.com/tag-platform/devguides/consent#redact_ads_data
|
50
|
+
ga4()('set', 'ads_data_redaction', true);
|
51
|
+
}
|
52
|
+
// We presume these are added from GTM
|
53
|
+
if (!useGa4EventsFromGtm) {
|
54
|
+
w.gtag('js', new Date());
|
55
|
+
if (process.env.REACT_APP_DEBUG_MODE === 'true') {
|
56
|
+
ga4()('config', trackingId, {
|
57
|
+
debug_mode: true
|
58
|
+
});
|
59
|
+
}
|
60
|
+
else {
|
61
|
+
ga4()('config', trackingId);
|
62
|
+
}
|
63
|
+
additionalGtagTrackingIds.forEach((id) => {
|
64
|
+
ga4()('config', id);
|
65
|
+
});
|
66
|
+
injectScript({
|
67
|
+
src: `https://www.googletagmanager.com/gtag/js?id=${trackingId}`
|
68
|
+
});
|
69
|
+
}
|
70
|
+
ga4();
|
71
|
+
},
|
72
|
+
consent(consents) {
|
73
|
+
const cookies = new Cookies();
|
74
|
+
// Fallback to all granted if no consents are passed
|
75
|
+
const consent = consents
|
76
|
+
? consents
|
77
|
+
: {
|
78
|
+
ad_storage: 'granted',
|
79
|
+
analytics_storage: 'granted',
|
80
|
+
personalization_storage: 'granted',
|
81
|
+
functionality_storage: 'granted',
|
82
|
+
security_storage: 'granted'
|
83
|
+
};
|
84
|
+
ga4()('consent', 'update', Object.assign({}, consent));
|
85
|
+
cookies.set(CONSENT_COOKIE_NAME, JSON.stringify(Object.assign({}, consent)));
|
86
|
+
},
|
87
|
+
trackProduct({ quantity, action, product, selectedVariation, list, listName, index, category }, context, eventId) {
|
88
|
+
const productItem = Object.assign(Object.assign({}, productToItem(product, selectedVariation, useArticleNumberAsId, brandCustomField, category)), { quantity, item_list_name: list || listName || context.list, index: index });
|
89
|
+
switch (action) {
|
90
|
+
case 'click':
|
91
|
+
ga4()('event', 'select_item', {
|
92
|
+
content_type: 'product',
|
93
|
+
currency,
|
94
|
+
value: product.price.incVat,
|
95
|
+
items: [productItem],
|
96
|
+
eventId
|
97
|
+
});
|
98
|
+
break;
|
99
|
+
case 'view':
|
100
|
+
ga4()('event', 'view_item', {
|
101
|
+
currency,
|
102
|
+
value: product.price.incVat,
|
103
|
+
items: [productItem],
|
104
|
+
eventId
|
105
|
+
});
|
106
|
+
break;
|
107
|
+
case 'add':
|
108
|
+
ga4()('event', 'add_to_cart', {
|
109
|
+
currency,
|
110
|
+
value: product.price.incVat,
|
111
|
+
items: [productItem],
|
112
|
+
eventId
|
113
|
+
});
|
114
|
+
break;
|
115
|
+
case 'remove':
|
116
|
+
ga4()('event', 'remove_from_cart', {
|
117
|
+
currency,
|
118
|
+
value: product.price.incVat,
|
119
|
+
items: [productItem],
|
120
|
+
eventId
|
121
|
+
});
|
122
|
+
break;
|
123
|
+
default:
|
124
|
+
console.log('Error: Gtag can not track action ' + action);
|
125
|
+
break;
|
126
|
+
}
|
127
|
+
},
|
128
|
+
// This event is disabled in GA4 so that the event fires on the Checkout Page instead using tag manager
|
129
|
+
// trackCartCheckout({ cart }, _context) {
|
130
|
+
// const items: GA4Item[] = cart.items.map((item) => ({
|
131
|
+
// ...productToItem(
|
132
|
+
// item.product as Product,
|
133
|
+
// item.variant,
|
134
|
+
// useArticleNumberAsId,
|
135
|
+
// brandCustomField
|
136
|
+
// ),
|
137
|
+
// quantity: item.quantity
|
138
|
+
// }));
|
139
|
+
// ga4()('event', 'begin_checkout', {
|
140
|
+
// currency: currency,
|
141
|
+
// value: cart.productTotal.incVat,
|
142
|
+
// items
|
143
|
+
// });
|
144
|
+
// },
|
145
|
+
trackPageView({ pathname, title }, _context, eventId) {
|
146
|
+
ga4()('event', 'page_view', {
|
147
|
+
currency,
|
148
|
+
page_path: pathname,
|
149
|
+
page_title: title,
|
150
|
+
eventId
|
151
|
+
});
|
152
|
+
},
|
153
|
+
trackList({ listName, products, category = '' }, _context, eventId) {
|
154
|
+
const items = products.map((product, i) => {
|
155
|
+
var _a;
|
156
|
+
return (Object.assign(Object.assign({}, productToItem(product, null, useArticleNumberAsId, brandCustomField, category)), { price: (_a = product.price) === null || _a === void 0 ? void 0 : _a.incVat, item_list_name: listName, index: i }));
|
157
|
+
});
|
158
|
+
ga4()('event', 'view_item_list', {
|
159
|
+
item_list_id: category,
|
160
|
+
item_list_name: listName,
|
161
|
+
items,
|
162
|
+
eventId
|
163
|
+
});
|
164
|
+
},
|
165
|
+
trackExperiment({ id, variant }, _context, eventId) {
|
166
|
+
ga4()('config', trackingId, {
|
167
|
+
experiments: [{ id, variant }],
|
168
|
+
eventId
|
169
|
+
});
|
170
|
+
},
|
171
|
+
trackUser({ userId }, _context, eventId) {
|
172
|
+
ga4()('event', 'authentication', { user_id: userId, eventId });
|
173
|
+
},
|
174
|
+
trackLogin(_props, _context, eventId) {
|
175
|
+
ga4()('event', 'login', { trackingId, eventId });
|
176
|
+
},
|
177
|
+
trackRegister(_props, _context, eventId) {
|
178
|
+
ga4()('event', 'sign_up', { trackingId, eventId });
|
179
|
+
},
|
180
|
+
trackAddToWishList({ articleNumber, productName }, _context, eventId) {
|
181
|
+
ga4()('event', 'add_to_wishlist', {
|
182
|
+
articleNumber,
|
183
|
+
productName,
|
184
|
+
eventId
|
185
|
+
});
|
186
|
+
}
|
187
|
+
};
|
188
|
+
}
|
189
|
+
//# sourceMappingURL=ga4.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ga4.js","sourceRoot":"","sources":["ga4.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,GAAG,GAAG,GAAG,EAAE,CAAE,MAAc,CAAC,IAAI,CAAC;AAsBvC,SAAS,aAAa,CACpB,OAAgB,EAChB,iBAAiC,EACjC,oBAAoB,GAAG,KAAK,EAC5B,gBAAyB,EACzB,QAAiB;;IAEjB,MAAM,eAAe,GAAG,QAAQ;SAC7B,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,OAAO,CAAC;SACf,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;QACpB,IAAI,CAAC,KAAK,CAAC,EAAE;YACX,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC;SACvB;aAAM;YACL,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAyB,CAAC,GAAG,CAAC,CAAC;SACzD;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAmB,CAAC,CAAC;IAE1B,uBACE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EACxB,OAAO,EAAE,oBA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tagTrackingIds, currency, brandCustomField, useArticleNumberAsId }: {
|
3
|
+
trackingId: string;
|
4
|
+
additionalGtagTrackingIds: string[];
|
5
|
+
currency: string;
|
6
|
+
brandCustomField?: string;
|
7
|
+
useArticleNumberAsId?: boolean;
|
8
|
+
}) => Tracker;
|
@@ -0,0 +1,209 @@
|
|
1
|
+
import { injectScript } from '../../utils/script';
|
2
|
+
import { getBrand } from '../../../components/OpenGraph/OpenGraphProductData';
|
3
|
+
import { unSlugify } from '../unslugify';
|
4
|
+
import { breadcrumbsWithoutProduct } from '../../utils/breadcrumbsWithoutProduct';
|
5
|
+
import { CONSENT_COOKIE_NAME, defaultConsentSettings } from '../../AnalyticsProvider';
|
6
|
+
import { Cookies } from 'react-cookie';
|
7
|
+
const ua = () => window.gtag;
|
8
|
+
function getProductData({ product, selectedVariation, useArticleNumberAsId = false, brandCustomField, category = '' }) {
|
9
|
+
const brand = getBrand(product, brandCustomField);
|
10
|
+
if (useArticleNumberAsId) {
|
11
|
+
return {
|
12
|
+
id: (selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.articleNumber) || product.articleNumber,
|
13
|
+
productId: product.id,
|
14
|
+
productSKU: product.articleNumber,
|
15
|
+
variant: selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.values.join('_'),
|
16
|
+
variantSKU: selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.articleNumber,
|
17
|
+
name: product.name,
|
18
|
+
base_product: product.articleNumber,
|
19
|
+
category,
|
20
|
+
brand
|
21
|
+
};
|
22
|
+
}
|
23
|
+
else {
|
24
|
+
// This is kept as backwards compatibility. Some shops rely on the product id being the internal Jetshop id, instead of the article number.
|
25
|
+
// Changing this could affect the statistics in Google Ads/Merchant/Analytics, so we want the new behaviour to be opt-in.
|
26
|
+
return {
|
27
|
+
id: product.id,
|
28
|
+
variant: (selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.articleNumber) || product.articleNumber,
|
29
|
+
name: product.name,
|
30
|
+
base_prduct: product.articleNumber,
|
31
|
+
category,
|
32
|
+
brand
|
33
|
+
};
|
34
|
+
}
|
35
|
+
}
|
36
|
+
export const gtagTracker = ({ trackingId, additionalGtagTrackingIds = [], currency, brandCustomField, useArticleNumberAsId = false }) => ({
|
37
|
+
name: 'gtag',
|
38
|
+
initBrowser({ config }) {
|
39
|
+
const w = window;
|
40
|
+
w.dataLayer = w.dataLayer || [];
|
41
|
+
w.dataLayer.push({
|
42
|
+
'gtm.start': new Date().getTime(),
|
43
|
+
event: 'gtm.js',
|
44
|
+
originalLocation: document.location.protocol +
|
45
|
+
'//' +
|
46
|
+
document.location.hostname +
|
47
|
+
document.location.pathname +
|
48
|
+
document.location.search
|
49
|
+
});
|
50
|
+
w.gtag = function gtag() {
|
51
|
+
w.dataLayer.push(arguments); // I'm not sure why but this dosen't work using rest params. Don't change this line
|
52
|
+
};
|
53
|
+
if (config.useTrackingConsentAPI) {
|
54
|
+
const consents = config.cookies.get(CONSENT_COOKIE_NAME) || defaultConsentSettings;
|
55
|
+
// NB: Only cookieless pings will be sent to Google servers.
|
56
|
+
// There’s also a wait time of 500 milliseconds before any Google tags are allowed to fire,
|
57
|
+
// to give time for the update command to be invoked.
|
58
|
+
ua()('consent', 'default', Object.assign({}, consents));
|
59
|
+
// NB: This only works when you set ad_storage to denied.
|
60
|
+
// https://developers.google.com/tag-platform/devguides/consent#redact_ads_data
|
61
|
+
ua()('set', 'ads_data_redaction', true);
|
62
|
+
}
|
63
|
+
w.gtag('js', new Date());
|
64
|
+
ua()('config', trackingId, {
|
65
|
+
currency,
|
66
|
+
send_page_view: false
|
67
|
+
});
|
68
|
+
additionalGtagTrackingIds.forEach((id) => {
|
69
|
+
ua()('config', id, {
|
70
|
+
currency,
|
71
|
+
send_page_view: false
|
72
|
+
});
|
73
|
+
});
|
74
|
+
injectScript({
|
75
|
+
src: `https://www.googletagmanager.com/gtag/js?id=${trackingId}`
|
76
|
+
});
|
77
|
+
ua();
|
78
|
+
},
|
79
|
+
consent(consents) {
|
80
|
+
const cookies = new Cookies();
|
81
|
+
// Fallback to all granted if no consents are passed
|
82
|
+
const consent = consents
|
83
|
+
? consents
|
84
|
+
: {
|
85
|
+
ad_storage: 'granted',
|
86
|
+
analytics_storage: 'granted',
|
87
|
+
personalization_storage: 'granted',
|
88
|
+
functionality_storage: 'granted',
|
89
|
+
security_storage: 'granted'
|
90
|
+
};
|
91
|
+
ua()('consent', 'update', Object.assign({}, consent));
|
92
|
+
cookies.set(CONSENT_COOKIE_NAME, JSON.stringify(Object.assign({}, consent)));
|
93
|
+
},
|
94
|
+
trackProduct({ quantity, action, product, selectedVariation, list, listName, index, category }, context, eventId) {
|
95
|
+
const productData = Object.assign(Object.assign({}, getProductData({
|
96
|
+
product,
|
97
|
+
selectedVariation,
|
98
|
+
useArticleNumberAsId,
|
99
|
+
brandCustomField,
|
100
|
+
category
|
101
|
+
})), { price: (selectedVariation && selectedVariation.price.incVat) ||
|
102
|
+
(product.price && product.price.incVat), quantity, list_name: list || listName || context.list, list_position: index });
|
103
|
+
switch (action) {
|
104
|
+
case 'click':
|
105
|
+
ua()('event', 'select_content', {
|
106
|
+
currency,
|
107
|
+
content_type: 'product',
|
108
|
+
items: [productData],
|
109
|
+
eventId
|
110
|
+
});
|
111
|
+
break;
|
112
|
+
case 'view':
|
113
|
+
ua()('event', 'view_item', {
|
114
|
+
currency,
|
115
|
+
items: [productData],
|
116
|
+
non_interaction: true,
|
117
|
+
eventId
|
118
|
+
});
|
119
|
+
break;
|
120
|
+
case 'add':
|
121
|
+
ua()('event', 'add_to_cart', {
|
122
|
+
currency,
|
123
|
+
items: [productData],
|
124
|
+
eventId
|
125
|
+
});
|
126
|
+
break;
|
127
|
+
case 'remove':
|
128
|
+
ua()('event', 'remove_from_cart', {
|
129
|
+
currency,
|
130
|
+
items: [productData],
|
131
|
+
eventId
|
132
|
+
});
|
133
|
+
break;
|
134
|
+
default:
|
135
|
+
console.log('Error: Gtag can not track action ' + action);
|
136
|
+
break;
|
137
|
+
}
|
138
|
+
},
|
139
|
+
trackCartCheckout({ cart }, _context, eventId) {
|
140
|
+
const items = cart.items.map((item) => {
|
141
|
+
var _a, _b, _c;
|
142
|
+
return (Object.assign(Object.assign({}, getProductData({
|
143
|
+
product: item.product,
|
144
|
+
selectedVariation: item.variant,
|
145
|
+
useArticleNumberAsId,
|
146
|
+
brandCustomField,
|
147
|
+
category: breadcrumbsWithoutProduct((_a = item.product.primaryRoute) === null || _a === void 0 ? void 0 : _a.breadcrumbs) ||
|
148
|
+
unSlugify((_c = (_b = item.product.canonicalCategory) === null || _b === void 0 ? void 0 : _b.primaryRoute) === null || _c === void 0 ? void 0 : _c.path) ||
|
149
|
+
''
|
150
|
+
})), { price: item.total.incVat, quantity: item.quantity }));
|
151
|
+
});
|
152
|
+
ua()('event', 'begin_checkout', {
|
153
|
+
currency,
|
154
|
+
items,
|
155
|
+
eventId
|
156
|
+
});
|
157
|
+
},
|
158
|
+
trackPageView({ pathname, title }, _context, eventId) {
|
159
|
+
ua()('event', 'page_view', {
|
160
|
+
currency,
|
161
|
+
page_path: pathname,
|
162
|
+
page_title: title,
|
163
|
+
eventId
|
164
|
+
});
|
165
|
+
},
|
166
|
+
trackList({ listName, products, category }, _context, eventId) {
|
167
|
+
const productData = products.map((product, i) => {
|
168
|
+
var _a, _b, _c, _d;
|
169
|
+
return (Object.assign(Object.assign({}, getProductData({
|
170
|
+
product,
|
171
|
+
selectedVariation: null,
|
172
|
+
useArticleNumberAsId,
|
173
|
+
brandCustomField,
|
174
|
+
category: category ||
|
175
|
+
breadcrumbsWithoutProduct((_a = product === null || product === void 0 ? void 0 : product.primaryRoute) === null || _a === void 0 ? void 0 : _a.breadcrumbs) ||
|
176
|
+
unSlugify((_c = (_b = product === null || product === void 0 ? void 0 : product.canonicalCategory) === null || _b === void 0 ? void 0 : _b.primaryRoute) === null || _c === void 0 ? void 0 : _c.path)
|
177
|
+
})), { price: (_d = product.price) === null || _d === void 0 ? void 0 : _d.incVat, list_name: listName, list_position: i }));
|
178
|
+
});
|
179
|
+
ua()('event', 'view_item_list', {
|
180
|
+
currency,
|
181
|
+
items: productData,
|
182
|
+
non_interaction: true,
|
183
|
+
eventId
|
184
|
+
});
|
185
|
+
},
|
186
|
+
trackExperiment({ id, variant }, _context, eventId) {
|
187
|
+
ua()('config', trackingId, {
|
188
|
+
experiments: [{ id, variant }],
|
189
|
+
eventId
|
190
|
+
});
|
191
|
+
},
|
192
|
+
trackUser({ userId }, _context, eventId) {
|
193
|
+
ua()('event', 'authentication', { user_id: userId, eventId });
|
194
|
+
},
|
195
|
+
trackLogin(_props, _context, eventId) {
|
196
|
+
ua()('event', 'login', { trackingId, eventId });
|
197
|
+
},
|
198
|
+
trackRegister(_props, _context, eventId) {
|
199
|
+
ua()('event', 'sign_up', { trackingId, eventId });
|
200
|
+
},
|
201
|
+
trackAddToWishList({ articleNumber, productName }, _context, eventId) {
|
202
|
+
ua()('event', 'add_to_wishlist', {
|
203
|
+
articleNumber,
|
204
|
+
productName,
|
205
|
+
eventId
|
206
|
+
});
|
207
|
+
}
|
208
|
+
});
|
209
|
+
//# sourceMappingURL=gtag.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"gtag.js","sourceRoot":"","sources":["gtag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,oDAAoD,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,EAAE,GAAG,GAAG,EAAE,CAAE,MAAc,CAAC,IAAI,CAAC;AAEtC,SAAS,cAAc,CAAC,EACtB,OAAO,EACP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AAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO;QAChD,EAAE,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE;YACzB,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;YAC9B,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IACD,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO;QACrC,EAAE,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO;QAClC,EAAE,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO;QACrC,EAAE,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,kBAAkB,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO;QAClE,EAAE,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE;YAC/B,aAAa;YACb,WAAW;YACX,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './gtag';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Tracker } from './../../trackerRegistry';
|
2
|
+
declare global {
|
3
|
+
interface Window {
|
4
|
+
dataLayer: any[];
|
5
|
+
}
|
6
|
+
}
|
7
|
+
export declare const gtmTracker: ({ containerId, currency, useArticleNumberAsId, brandCustomField }: {
|
8
|
+
containerId: string;
|
9
|
+
currency: string;
|
10
|
+
brandCustomField?: string;
|
11
|
+
useArticleNumberAsId?: boolean;
|
12
|
+
}) => Tracker;
|