aesirx-analytics 1.2.2 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +36 -5
- package/dist/Consent-6SCX7LT4.js +8295 -0
- package/dist/analytics.js +17835 -40
- package/dist/chunk-JQ6CXYV4.js +34 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.js +276 -1
- package/package.json +8 -4
- package/dist/Consent-4MLNPIUE.js +0 -1
- package/dist/chunk-D75AKWUD.js +0 -5
package/README.md
CHANGED
@@ -19,11 +19,24 @@ Follow the instructions in: [https://github.com/aesirxio/analytics-1stparty](htt
|
|
19
19
|
1. Add script to `<head>`:
|
20
20
|
|
21
21
|
```
|
22
|
-
<script>
|
22
|
+
<script>
|
23
|
+
window.aesirx1stparty = "https://example.com"
|
24
|
+
window.aesirxClientID="[REPLACE THIS WITH THE PROVIDED CLIENT_ID]"
|
25
|
+
window.aesirxClientSecret="[REPLACE THIS WITH THE PROVIDED CLIENT_SECRET]"
|
26
|
+
</script>
|
23
27
|
<script async defer src="YOUR_PROJECT_PATH/analytics.js"></script>
|
24
28
|
```
|
25
29
|
|
26
|
-
(`https://example.com` is the link to your 1st party server which must be installed)
|
30
|
+
1. (`https://example.com` is the link to your 1st party server which must be installed)
|
31
|
+
2. `CLIENT_ID` replace this with the provided `CLIENT_ID` from https://sso.aesirx.io/
|
32
|
+
3. `CLIENT_SECRET` replace this with the provided `CLIENT_SECRET` from https://sso.aesirx.io/
|
33
|
+
|
34
|
+
##### Disable Consent Popup:
|
35
|
+
```
|
36
|
+
<script>
|
37
|
+
window.disableAnalyticsConsent = "true"
|
38
|
+
</script>
|
39
|
+
```
|
27
40
|
|
28
41
|
#### Usage in ReactJS
|
29
42
|
|
@@ -33,8 +46,18 @@ Follow the instructions in: [https://github.com/aesirxio/analytics-1stparty](htt
|
|
33
46
|
|
34
47
|
```
|
35
48
|
REACT_APP_ENDPOINT_ANALYTICS_URL=https://example.com
|
49
|
+
REACT_APP_SSO_CLIENT_ID=[REPLACE THIS WITH THE PROVIDED CLIENT_ID]
|
50
|
+
REACT_APP_SSO_CLIENT_SECRET=[REPLACE THIS WITH THE PROVIDED CLIENT_SECRET]
|
36
51
|
|
37
52
|
(https://example.com is the link to your 1st party server)
|
53
|
+
`CLIENT_ID` replace this with the provided `CLIENT_ID` from https://sso.aesirx.io/
|
54
|
+
`CLIENT_SECRET` replace this with the provided `CLIENT_SECRET` from https://sso.aesirx.io/
|
55
|
+
```
|
56
|
+
|
57
|
+
##### Disable Consent Popup:
|
58
|
+
add this environment variable to `.env`
|
59
|
+
```
|
60
|
+
REACT_APP_DISABLE_ANALYTICS_CONSENT=true
|
38
61
|
```
|
39
62
|
|
40
63
|
###### With react-router-dom v5:
|
@@ -66,8 +89,18 @@ export default AnalyticsContainer;
|
|
66
89
|
|
67
90
|
```
|
68
91
|
NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL=https://example.com
|
92
|
+
NEXT_PUBLIC_SSO_CLIENT_ID=[REPLACE THIS WITH THE PROVIDED CLIENT_ID]
|
93
|
+
NEXT_PUBLIC_SSO_CLIENT_SECRET=[REPLACE THIS WITH THE PROVIDED CLIENT_SECRET]
|
69
94
|
|
70
95
|
(https://example.com is the link to your 1st party server)
|
96
|
+
`CLIENT_ID` replace this with the provided `CLIENT_ID` from https://sso.aesirx.io/
|
97
|
+
`CLIENT_SECRET` replace this with the provided `CLIENT_SECRET` from https://sso.aesirx.io/
|
98
|
+
```
|
99
|
+
|
100
|
+
##### Disable Consent Popup:
|
101
|
+
add this environment variable to `.env`
|
102
|
+
```
|
103
|
+
NEXT_PUBLIC_DISABLE_ANALYTICS_CONSENT=true
|
71
104
|
```
|
72
105
|
|
73
106
|
###### With next/router:
|
@@ -113,13 +146,11 @@ data-aesirx-event-attribute-<attribute-name-2>="<attribute-value-1>"
|
|
113
146
|
##### Or you can use your own Javascript to Track events:
|
114
147
|
|
115
148
|
```
|
116
|
-
window.trackEvent(endpoint,
|
149
|
+
window.trackEvent(endpoint, referer, data)
|
117
150
|
```
|
118
151
|
|
119
152
|
(`endpoint` is the link to your 1st party server which must be installed)
|
120
153
|
|
121
|
-
(`visitor_uuid` is the params get from url - it will auto generated)
|
122
|
-
|
123
154
|
(`referer` is the referer domain)
|
124
155
|
|
125
156
|
(`data` is the data you want to track)
|