@dotcms/experiments 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -36
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,40 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dotCMS Experiments SDK
|
|
2
2
|
|
|
3
|
-
`@dotcms/experiments` is the official dotCMS JavaScript library that helps add A/B testing to your
|
|
3
|
+
The `@dotcms/experiments` SDK is the official dotCMS JavaScript library that helps add A/B testing to your web applications. It handles user assignments to different variants of a page and tracks their interactions.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Link Verification for Redirection**: Checks links to ensure users are redirected to their assigned experiment variant, maintaining the integrity of the testing process.
|
|
9
|
-
- **Automatic PageView Event Sending**: Automatically sends PageView events to DotCMS Analytics, enabling real-time tracking of user engagement and experiment effectiveness.
|
|
7
|
+
### When to Use It
|
|
10
8
|
|
|
9
|
+
- Adding A/B testing capabilities to your web application
|
|
10
|
+
- Running experiments to optimize user experience
|
|
11
|
+
- Testing different page variants with real users
|
|
12
|
+
- Tracking experiment performance with DotCMS Analytics
|
|
11
13
|
|
|
14
|
+
### Key Features
|
|
15
|
+
|
|
16
|
+
- **User Assignment to Experiments**: Automatically assigns users to different experimental variants, ensuring diverse user experiences and reliable test data
|
|
17
|
+
- **Link Verification for Redirection**: Checks links to ensure users are redirected to their assigned experiment variant, maintaining the integrity of the testing process
|
|
18
|
+
- **Automatic PageView Event Sending**: Automatically sends PageView events to DotCMS Analytics, enabling real-time tracking of user engagement and experiment effectiveness
|
|
19
|
+
|
|
20
|
+
## Table of Contents
|
|
21
|
+
|
|
22
|
+
- [Overview](#overview)
|
|
23
|
+
- [Installation](#installation)
|
|
24
|
+
- [Getting Started](#getting-started)
|
|
25
|
+
- [Components](#components)
|
|
26
|
+
- [How A/B Testing Works](#how-ab-testing-works-with-dotcmsexperiments)
|
|
27
|
+
- [Usage](#usage)
|
|
28
|
+
- [Support](#support)
|
|
29
|
+
- [Contributing](#contributing)
|
|
30
|
+
- [Licensing](#licensing)
|
|
12
31
|
|
|
13
32
|
## Installation
|
|
14
|
-
|
|
33
|
+
|
|
34
|
+
Install the package via npm:
|
|
15
35
|
|
|
16
36
|
```bash
|
|
17
37
|
npm install @dotcms/experiments
|
|
18
38
|
```
|
|
39
|
+
|
|
19
40
|
Or using Yarn:
|
|
20
41
|
|
|
21
42
|
```bash
|
|
22
43
|
yarn add @dotcms/experiments
|
|
23
44
|
```
|
|
24
45
|
|
|
46
|
+
## Getting Started
|
|
25
47
|
|
|
26
|
-
|
|
48
|
+
### Components
|
|
27
49
|
|
|
28
50
|
### `DotExperimentsProvider`
|
|
29
51
|
This component utilizes React's Context API to provide DotExperiments instances to its descendants, facilitating access to A/B testing features throughout your webapps.
|
|
30
52
|
|
|
31
53
|
#### Props
|
|
32
|
-
- **config**: Configuration object for DotCMS Analytics integration.
|
|
33
|
-
- **apiKey**: Your API key from the DotCMS Analytics app.
|
|
34
|
-
- **server**: The URL of your DotCMS instance.
|
|
35
|
-
- **redirectFn**: The redirect function to use when assigning users to experiment variants.
|
|
36
54
|
|
|
37
|
-
|
|
55
|
+
- **config**: Configuration object for DotCMS Analytics integration
|
|
56
|
+
- **apiKey**: Your API key from the DotCMS Analytics app
|
|
57
|
+
- **server**: The URL of your dotCMS instance
|
|
58
|
+
- **redirectFn**: The redirect function to use when assigning users to experiment variants
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
38
61
|
|
|
39
62
|
```javascript
|
|
40
63
|
import { DotExperimentsProvider } from "@dotcms/experiments";
|
|
@@ -61,45 +84,50 @@ return (
|
|
|
61
84
|
);
|
|
62
85
|
```
|
|
63
86
|
|
|
64
|
-
|
|
87
|
+
### How A/B Testing Works with @dotcms/experiments
|
|
65
88
|
|
|
66
89
|
The A/B testing process with `@dotcms/experiments` is designed to be straightforward and automatic:
|
|
67
90
|
|
|
68
|
-
1. **Experiment Assignment**: When a user visits a page that includes an experiment, the library first checks if the user has been assigned to an experiment variant. If not, it queries DotCMS Analytics to determine if there are active experiments and assigns the user to the appropriate variant
|
|
91
|
+
1. **Experiment Assignment**: When a user visits a page that includes an experiment, the library first checks if the user has been assigned to an experiment variant. If not, it queries DotCMS Analytics to determine if there are active experiments and assigns the user to the appropriate variant
|
|
69
92
|
|
|
70
|
-
2. **Page Redirection**: If the user's assigned variant differs from the current page, the library automatically redirects the user to the correct variant page. This ensures that the user experiences the variant they have been assigned to
|
|
93
|
+
2. **Page Redirection**: If the user's assigned variant differs from the current page, the library automatically redirects the user to the correct variant page. This ensures that the user experiences the variant they have been assigned to
|
|
71
94
|
|
|
72
|
-
3. **Tracking Pageviews**: After redirection or upon visiting the page, the library sends a pageview event to DotCMS Analytics. This data is used to determine the effectiveness of each variant, ultimately helping to identify which variant performs better in the A/B test
|
|
95
|
+
3. **Tracking Pageviews**: After redirection or upon visiting the page, the library sends a pageview event to DotCMS Analytics. This data is used to determine the effectiveness of each variant, ultimately helping to identify which variant performs better in the A/B test
|
|
73
96
|
|
|
97
|
+
**Learn More**: For more detailed information on A/B testing features and capabilities, visit the [DotCMS A/B Testing Experiments](https://www.dotcms.com/product/ab-testing-experiments) page.
|
|
74
98
|
|
|
75
|
-
##
|
|
99
|
+
## Support
|
|
76
100
|
|
|
77
|
-
|
|
101
|
+
We offer multiple channels to get help with the dotCMS Experiments SDK:
|
|
78
102
|
|
|
103
|
+
- **GitHub Issues**: For bug reports and feature requests, please [open an issue](https://github.com/dotCMS/core/issues/new/choose) in the GitHub repository
|
|
104
|
+
- **Community Forum**: Join our [community discussions](https://community.dotcms.com/) to ask questions and share solutions
|
|
105
|
+
- **Stack Overflow**: Use the tag `dotcms-experiments` when posting questions
|
|
106
|
+
- **Enterprise Support**: Enterprise customers can access premium support through the [dotCMS Support Portal](https://helpdesk.dotcms.com/support/)
|
|
79
107
|
|
|
80
|
-
|
|
108
|
+
When reporting issues, please include:
|
|
81
109
|
|
|
82
|
-
|
|
110
|
+
- SDK version you're using
|
|
111
|
+
- Framework/library version (if applicable)
|
|
112
|
+
- Minimal reproduction steps
|
|
113
|
+
- Expected vs. actual behavior
|
|
83
114
|
|
|
84
|
-
##
|
|
115
|
+
## Contributing
|
|
85
116
|
|
|
86
|
-
|
|
117
|
+
GitHub pull requests are the preferred method to contribute code to dotCMS. We welcome contributions to the dotCMS Experiments SDK! If you'd like to contribute, please follow these steps:
|
|
87
118
|
|
|
88
|
-
|
|
119
|
+
1. Fork the repository [dotCMS/core](https://github.com/dotCMS/core)
|
|
120
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
121
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
122
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
123
|
+
5. Open a Pull Request
|
|
89
124
|
|
|
90
|
-
|
|
125
|
+
Please ensure your code follows the existing style and includes appropriate tests.
|
|
91
126
|
|
|
92
|
-
|
|
127
|
+
Before any pull requests can be accepted, an automated tool will ask you to agree to the [dotCMS Contributor's Agreement](https://gist.github.com/wezell/85ef45298c48494b90d92755b583acb3).
|
|
93
128
|
|
|
94
|
-
|
|
129
|
+
## Licensing
|
|
95
130
|
|
|
96
|
-
|
|
131
|
+
dotCMS comes in multiple editions and as such is dual-licensed. The dotCMS Community Edition is licensed under the GPL 3.0 and is freely available for download, customization, and deployment for use within organizations of all stripes. dotCMS Enterprise Editions (EE) adds several enterprise features and is available via a supported, indemnified commercial license from dotCMS. For the differences between the editions, see [the feature page](http://www.dotcms.com/cms-platform/features).
|
|
97
132
|
|
|
98
|
-
|
|
99
|
-
| --------------- | ------------------------------------------------------------------- |
|
|
100
|
-
| Installation | [Installation](https://dotcms.com/docs/latest/installation) |
|
|
101
|
-
| Documentation | [Documentation](https://dotcms.com/docs/latest/table-of-contents) |
|
|
102
|
-
| Videos | [Helpful Videos](http://dotcms.com/videos/) |
|
|
103
|
-
| Forums/Listserv | [via Google Groups](https://groups.google.com/forum/#!forum/dotCMS) |
|
|
104
|
-
| Twitter | @dotCMS |
|
|
105
|
-
| Main Site | [dotCMS.com](https://dotcms.com/) |
|
|
133
|
+
This SDK is part of dotCMS's dual-licensed platform (GPL 3.0 for Community, commercial license for Enterprise).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcms/experiments",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Official JavaScript library to use Experiments with DotCMS.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": ">=18",
|
|
27
27
|
"react-dom": ">=18",
|
|
28
|
-
"@dotcms/client": "^1.
|
|
29
|
-
"@dotcms/react": "^1.
|
|
30
|
-
"@dotcms/uve": "^1.
|
|
31
|
-
"@dotcms/types": "^1.
|
|
28
|
+
"@dotcms/client": "^1.2.0",
|
|
29
|
+
"@dotcms/react": "^1.2.0",
|
|
30
|
+
"@dotcms/uve": "^1.2.0",
|
|
31
|
+
"@dotcms/types": "^1.2.0"
|
|
32
32
|
},
|
|
33
33
|
"module": "./index.esm.js",
|
|
34
34
|
"type": "module",
|