@jetshop/core 3.13.3 → 3.13.5-non-polyfill
Sign up to get free protection for your applications and to get access to all the features.
- package/boot/addMissingConfig.d.ts +1 -0
- package/boot/server/createRenderer.js +4 -3
- package/boot/server/createRenderer.js.map +1 -1
- package/components/Auth/formFieldsFromSettings.d.ts +10 -10
- package/components/Auth/useAddressFields.d.ts +3 -3
- package/components/Auth/useCustomer.d.ts +6 -6
- package/components/Auth/useLoginFields.d.ts +3 -3
- package/components/ConfigProvider.d.ts +2 -0
- package/components/ConfigProvider.js.map +1 -1
- package/components/ProductVariationProvider/ProductVariationProvider.d.ts +4 -4
- package/components/ProductVariationProvider/ProductVariationProvider.js +3 -36
- package/components/ProductVariationProvider/ProductVariationProvider.js.map +1 -1
- package/components/ProductVariationProvider/ProductVariationProvider.test.js +1 -1
- package/components/ProductVariationProvider/getDefaultValuesFromUrl.d.ts +5 -0
- package/components/ProductVariationProvider/getDefaultValuesFromUrl.js +37 -0
- package/components/ProductVariationProvider/getDefaultValuesFromUrl.js.map +1 -0
- package/helpers/decodeUrlQuery.js +9 -1
- package/helpers/decodeUrlQuery.js.map +1 -1
- package/hooks/ProductList/list-transforms.d.ts +38 -29
- package/hooks/usePreconnectLinks.d.ts +1 -1
- package/hooks/usePreconnectLinks.js +3 -3
- package/hooks/usePreconnectLinks.js.map +1 -1
- package/hooks/usePrice.d.ts +1 -1
- package/hooks/useProductVariants/useProductVariants.js +2 -1
- package/hooks/useProductVariants/useProductVariants.js.map +1 -1
- package/hooks/useProductVariants/useVariantFromUrl.d.ts +5 -0
- package/hooks/useProductVariants/useVariantFromUrl.js +17 -0
- package/hooks/useProductVariants/useVariantFromUrl.js.map +1 -0
- package/hooks/useProductVariants/useVariantFromUrl.test.js +52 -0
- package/package.json +2 -3
- package/polyfills.d.ts +1 -1
- package/polyfills.js +18 -4
- package/polyfills.js.map +1 -1
- package/types.d.ts +1091 -551
- package/analytics/README.md +0 -81
package/analytics/README.md
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
# Analytics, tracking and ab-testing
|
2
|
-
|
3
|
-
The files in this directory take cares of tracking in different ways. The current functionality only support sending
|
4
|
-
data to google analytics but it is partly prepared for using different frameworks as well.
|
5
|
-
|
6
|
-
## What remains to do
|
7
|
-
* The google analytics id is hardcoded in tha call to `initGA/init(trackingID)` in `boot.tsx`, that should be in
|
8
|
-
a config file.
|
9
|
-
* Support for other analytics/tracking tools
|
10
|
-
* Perhaps support for multiple experiments. There are however not to smart to have multiple experiments running at the
|
11
|
-
same time since this can ruin the statistics. Also google analytics experiments does not support multiple experiments at
|
12
|
-
the same time.
|
13
|
-
* Update the queries for the new graphQL api/structure. Specifically how categories are handled.
|
14
|
-
* `init_experiment.ts` should be configured somewhere else.
|
15
|
-
* Track also non-product and category pages as page views. (There is support for this but it is not done in
|
16
|
-
the-gear-store, this might be needed to do in all stores). This also must be done to the pathname to be right for the
|
17
|
-
other tracking.
|
18
|
-
* Perhaps more explicit types in `tracking` and `googleAnalytics`.
|
19
|
-
* `trackList` should also make additional graphQL requests to ensure that we have all data we want to track. The one
|
20
|
-
thing that is not tracked in the-gear-store is the category of the product.
|
21
|
-
* Now showing the cart is tracked as the first step in the checkout procedure. This should probably be changed.
|
22
|
-
|
23
|
-
## How the tracking api is to be used in a store
|
24
|
-
* The tracking of pageviews is handled in `DynamicRoute` for product and category pages automatically. Fore other pages,
|
25
|
-
track by using the `Analytics` component with the `trackPage` function.
|
26
|
-
* Whenever a product is shown this should be tracked. If multiple products is shown it should be tracked as an
|
27
|
-
impression. This is done by the tracking function `trackList`. It is only when the details is viewed it should be
|
28
|
-
tracked with `trackProduct` with action view.
|
29
|
-
* The `trackProduct` supports the actions `click` (when a product is clicked), `view` (when the details about a product
|
30
|
-
is viewed), `add` (when added to the cart) and `remove` (when removed from the cart).
|
31
|
-
* The Experiment is set up with the `init_experiment` file and the experiment is then used as the example in the
|
32
|
-
product page in the-gear-store.
|
33
|
-
* There are `Analytics` components in the-gear-store at `Product`, `ProductGrid` ans `Cart`. These might not need to be
|
34
|
-
tracked in the store if some of the code is moved to the framework.
|
35
|
-
* For a/b testing there are three things to do. One should define the experiment in google analytics, make the
|
36
|
-
specifications in `init_experiment` and write the code for the experiment. The structure looks like this:
|
37
|
-
```
|
38
|
-
<Experiment name="TheNameOfTheExperiment">
|
39
|
-
<Variant name="control">
|
40
|
-
// this is shown for variation namned "control"
|
41
|
-
</Variant>
|
42
|
-
<Variant name="v1">
|
43
|
-
// This is shown for variation namned "v1"
|
44
|
-
</Variant>
|
45
|
-
</Experiment>
|
46
|
-
```
|
47
|
-
|
48
|
-
## Some design decisions
|
49
|
-
* The order of the variations in the code does not matter. Instead the order of the names in `init_experiment` and at
|
50
|
-
google analytics experiment (which have to be the same!) determine which is the "correct" order of the variants. The
|
51
|
-
names of the variant is what matters in the code.
|
52
|
-
* Since we can not access the `chooseVariation` function from the cxapi at the server and early enough, we decide the
|
53
|
-
variation version ourselves and store the chosen both in a cookie ourselves and send the selection via cxapi to track
|
54
|
-
the experiment in the experiment view in google analytics. This have the upside that it is easier to change google
|
55
|
-
analytics experiment to another framework.
|
56
|
-
* The `Category` component does not need a `Analytics` component but instead pass down the name of the category to the
|
57
|
-
`ProductGrid` that takes care of the tracking.
|
58
|
-
|
59
|
-
## Specific information about the files
|
60
|
-
|
61
|
-
* `abExperiments.tsx` - includes two classes that together forms an experiment. The exported class `Experiment` is the
|
62
|
-
class `ExperimentWithoutCookie` with `withCookie` and stores the variation id in a cookie that is also available on the
|
63
|
-
server. This class uses the `init_experiment` file to know how the experiments look like. The `Variation` class just
|
64
|
-
provides the property `name` that is used to determine what variation that is used.
|
65
|
-
* `init_experiment.ts` - used to specify how the experiment look like. See the file for an example.
|
66
|
-
The current supported fields are
|
67
|
-
```
|
68
|
-
experiment: string, // the name/custom id of the experiment
|
69
|
-
id: string, // the experiment id given from google analytics experiments
|
70
|
-
variations: string[], // list of variation namnes
|
71
|
-
weights: int[] // list of weigths for the different variations, this is used
|
72
|
-
// to calculate a percentage of traffic to the different versions.
|
73
|
-
```
|
74
|
-
* `Analytics.tsx` - component for tracking various things. Calls the track function on mounting.
|
75
|
-
* `tracking.ts` - there are three main tracking functions used to track a product, cart, list and page. These takes the
|
76
|
-
`TrackArguments` as input, product and cart do additional graphQL queries to make sure we have all the data we want to
|
77
|
-
track. All functions makes a call to some function in `googleAnalytics`. If no action are specified, `view` is the default.
|
78
|
-
* `googleAnalytics.ts` - using the ga-function provided by `initGA`, the data is send to google analytics.
|
79
|
-
* `initGA.js` - this contains the standard google analytics tracking script as well as exporting the ga function for use
|
80
|
-
in other files.
|
81
|
-
|