countly-sdk-web 22.2.2 → 22.2.3
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/.eslintignore +17 -17
- package/.eslintrc.js +215 -215
- package/.github/dependabot.yml +20 -20
- package/.github/workflows/codeql-analysis.yml +71 -71
- package/.github/workflows/documentation.yml +24 -0
- package/.github/workflows/node.js.yml +25 -41
- package/CHANGELOG.md +241 -237
- package/LICENSE +19 -19
- package/README.md +86 -122
- package/SECURITY.md +3 -3
- package/bower.json +29 -29
- package/cypress/.eslintrc.js +22 -22
- package/cypress/fixtures/base.html +8 -0
- package/cypress/fixtures/scroll_test.html +60 -0
- package/cypress/fixtures/scroll_test_2.html +48 -0
- package/cypress/fixtures/scroll_test_3.html +72 -0
- package/cypress/fixtures/session_test_auto.html +51 -0
- package/cypress/fixtures/session_test_manual_1.html +58 -0
- package/cypress/fixtures/session_test_manual_2.html +54 -0
- package/cypress/fixtures/user_agent.html +20 -0
- package/cypress/integration/consents.js +165 -165
- package/cypress/integration/device_id.js +1085 -830
- package/cypress/integration/events.js +65 -65
- package/cypress/integration/heatmaps.js +52 -0
- package/cypress/integration/internal_limits.js +153 -153
- package/cypress/integration/reponse_validation.js +170 -170
- package/cypress/integration/sessions.js +196 -60
- package/cypress/integration/user_agent.js +63 -0
- package/cypress/integration/user_details.js +40 -40
- package/cypress/integration/utm.js +236 -236
- package/cypress/integration/views.js +62 -62
- package/cypress/plugins/index.js +22 -22
- package/cypress/support/commands.js +322 -298
- package/cypress/support/helper.js +59 -59
- package/cypress/support/index.js +2 -2
- package/cypress/support/integration_helper.js +17 -0
- package/cypress.json +3 -1
- package/examples/example_apm.html +51 -51
- package/examples/example_fb.html +50 -50
- package/examples/example_formdata.html +47 -47
- package/examples/example_ga_adapter.html +173 -173
- package/examples/example_gdpr.html +82 -82
- package/examples/example_internal_limits.html +184 -184
- package/examples/example_multiple_instances.html +52 -52
- package/examples/example_rating_widgets.html +80 -80
- package/examples/example_remote_config.html +38 -38
- package/examples/example_sync.html +36 -36
- package/examples/examples_feedback_widgets.html +81 -81
- package/examples/mpa/boomerang/boomerang-1.0.0.js +22871 -22871
- package/examples/mpa/boomerang/countly_boomerang.js +138 -138
- package/examples/mpa/index.html +816 -816
- package/examples/react/README.md +35 -35
- package/examples/react/package.json +37 -37
- package/examples/react/public/index.html +19 -19
- package/examples/react/public/manifest.json +25 -25
- package/examples/react/public/robots.txt +3 -3
- package/examples/react/src/App-WithEffect.js +33 -33
- package/examples/react/src/App-WithRouter.js +46 -46
- package/examples/react/src/App.test.js +9 -9
- package/examples/react/src/Components/Contact.js +28 -28
- package/examples/react/src/Components/Header.js +88 -88
- package/examples/react/src/Components/Home.js +23 -23
- package/examples/react/src/Components/Users.js +43 -43
- package/examples/react/src/Components/styles.css +25 -25
- package/examples/react/src/ErrorBoundary.js +28 -28
- package/examples/react/src/Location-WithEffect.js +27 -27
- package/examples/react/src/Location-WithRouter.js +23 -23
- package/examples/react/src/index.css +5 -5
- package/examples/react/src/index.js +68 -68
- package/examples/react/src/serviceWorker.js +141 -141
- package/examples/react/src/setupTests.js +5 -5
- package/examples/symbolication/.babelrc +11 -11
- package/examples/symbolication/.editorconfig +8 -8
- package/examples/symbolication/.yo-rc.json +53 -53
- package/examples/symbolication/README.md +33 -33
- package/examples/symbolication/package.json +22 -22
- package/examples/symbolication/src/index.js +47 -47
- package/examples/symbolication/static/index.html +21 -21
- package/examples/symbolication/webpack.config.js +27 -27
- package/generateDocs.sh +80 -79
- package/inch.json +6 -6
- package/jsdoc_conf.json +4 -2
- package/lib/countly.js +4625 -4416
- package/lib/countly.min.js +126 -117
- package/package.json +57 -57
- package/plugin/boomerang/boomerang.min.js +10 -10
- package/plugin/boomerang/countly_boomerang.js +150 -150
- package/plugin/ga_adapter/doc.md +73 -73
- package/plugin/ga_adapter/ga_adapter.js +451 -451
- package/webpack.config.js +12 -12
- package/countly-sdk-web-22.2.2.tgz +0 -0
package/README.md
CHANGED
|
@@ -1,122 +1,86 @@
|
|
|
1
|
-
# Countly Web SDK
|
|
2
|
-
[ is a product analytics solution and innovation enabler that helps teams track product performance and customer journey and behavior across [mobile](https://count.ly/mobile-analytics), [web](http://count.ly/web-analytics), and [desktop](https://count.ly/desktop-analytics) applications. [Ensuring privacy by design](https://count.ly/your-data-your-rules), Countly allows you to innovate and enhance your products to provide personalized and customized customer experiences, and meet key business and revenue goals.
|
|
6
|
-
|
|
7
|
-
Track, measure, and take action - all without leaving Countly.
|
|
8
|
-
|
|
9
|
-
* **Slack user?** [Join our community](https://slack.count.ly) to ask questions and get answers!
|
|
10
|
-
* **Questions?** [Ask in our Community forum](https://support.count.ly/hc/en-us/community/topics)
|
|
11
|
-
|
|
12
|
-
## Implementing Countly SDK in your web pages
|
|
13
|
-
|
|
14
|
-
There are 3 ways to get Countly SDK.
|
|
15
|
-
|
|
16
|
-
### 1. Available with Countly server
|
|
17
|
-
Since Countly server 16.02, Countly Web SDK is available in your Countly server installation in `countly/frontend/express/public/sdk/web/countly.min.js` which should be available through URL as `https://yourserver.com/sdk/web/countly.min.js`
|
|
18
|
-
|
|
19
|
-
### 2. Installation using package managers
|
|
20
|
-
|
|
21
|
-
bower install countly-sdk-web
|
|
22
|
-
or
|
|
23
|
-
|
|
24
|
-
npm install countly-sdk-web
|
|
25
|
-
or
|
|
26
|
-
|
|
27
|
-
yarn add countly-sdk-web
|
|
28
|
-
|
|
29
|
-
### 3. Use a CDN (content delivery network)
|
|
30
|
-
|
|
31
|
-
Countly web SDK is available on CDNJS. Use either
|
|
32
|
-
|
|
33
|
-
[https://cdnjs.cloudflare.com/ajax/libs/countly-sdk-web/22.02.
|
|
34
|
-
|
|
35
|
-
or
|
|
36
|
-
|
|
37
|
-
[https://cdn.jsdelivr.net/npm/countly-sdk-web@latest/lib/countly.min.js](https://cdn.jsdelivr.net/npm/countly-sdk-web@latest/lib/countly.min.js)
|
|
38
|
-
|
|
39
|
-
## How to use Countly Web SDK?
|
|
40
|
-
|
|
41
|
-
Link to the script and call helper methods based on what you want to track: sessions, views, clicks, custom events, user data, etc.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
## Other Github resources
|
|
88
|
-
|
|
89
|
-
Check Countly Community Edition source code here:
|
|
90
|
-
|
|
91
|
-
- [Countly Server](https://github.com/Countly/countly-server)
|
|
92
|
-
|
|
93
|
-
There are also other Countly SDK repositories below:
|
|
94
|
-
|
|
95
|
-
- [Countly iOS SDK](https://github.com/Countly/countly-sdk-ios)
|
|
96
|
-
- [Countly Android SDK](https://github.com/Countly/countly-sdk-android)
|
|
97
|
-
- [Countly Windows Phone SDK](https://github.com/Countly/countly-sdk-windows-phone)
|
|
98
|
-
- [Countly Appcelerator Titanium SDK](https://github.com/euforic/Titanium-Count.ly) (Community supported)
|
|
99
|
-
- [Countly Unity3D SDK](https://github.com/Countly/countly-sdk-unity) (Community supported)
|
|
100
|
-
|
|
101
|
-
## How can I help you with your efforts?
|
|
102
|
-
|
|
103
|
-
Glad you asked. We need ideas, feedbacks and constructive comments. All your suggestions will be taken care with upmost importance. We are on [Twitter](http://twitter.com/gocountly) and [Facebook](https://www.facebook.com/Countly) if you would like to keep up with our fast progress!
|
|
104
|
-
|
|
105
|
-
## Badges
|
|
106
|
-
|
|
107
|
-
If you like Countly, [why not use one of our badges](https://count.ly/brand-assets) and give a link back to us, so others know about this wonderful platform?
|
|
108
|
-
|
|
109
|
-
<a href="https://count.ly/f/badge" rel="nofollow"><img style="width:145px;height:60px" src="https://count.ly/badges/dark.svg?v2" alt="Countly - Product Analytics" /></a>
|
|
110
|
-
|
|
111
|
-
<a href="https://count.ly/f/badge" rel="nofollow"><img style="width:145px;height:60px" src="https://count.ly/badges/dark.svg" alt="Countly - Product Analytics" /></a>
|
|
112
|
-
|
|
113
|
-
<a href="https://count.ly/f/badge" rel="nofollow"><img style="width:145px;height:60px" src="https://count.ly/badges/light.svg?v2" alt="Countly - Product Analytics" /></a>
|
|
114
|
-
|
|
115
|
-
<a href="https://count.ly/f/badge" rel="nofollow"><img style="width:145px;height:60px" src="https://count.ly/badges/light.svg" alt="Countly - Product Analytics" /></a>
|
|
116
|
-
|
|
117
|
-
## Support
|
|
118
|
-
|
|
119
|
-
For a public community support page, visit [https://support.count.ly/hc/en-us/community/topics](https://support.count.ly/hc/en-us/community/topics "Countly Community Forum").
|
|
120
|
-
|
|
121
|
-
[](https://nodei.co/npm/countly-sdk-web/)
|
|
122
|
-
|
|
1
|
+
# Countly Web SDK
|
|
2
|
+
[](https://www.codacy.com/gh/Countly/countly-sdk-web/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Countly/countly-sdk-web&utm_campaign=Badge_Grade) [](https://badge.fury.io/js/countly-sdk-web) [](https://www.jsdelivr.com/package/npm/countly-sdk-web)
|
|
3
|
+
|
|
4
|
+
## What is Countly?
|
|
5
|
+
[Countly](http://count.ly) is a product analytics solution and innovation enabler that helps teams track product performance and customer journey and behavior across [mobile](https://count.ly/mobile-analytics), [web](http://count.ly/web-analytics), and [desktop](https://count.ly/desktop-analytics) applications. [Ensuring privacy by design](https://count.ly/your-data-your-rules), Countly allows you to innovate and enhance your products to provide personalized and customized customer experiences, and meet key business and revenue goals.
|
|
6
|
+
|
|
7
|
+
Track, measure, and take action - all without leaving Countly.
|
|
8
|
+
|
|
9
|
+
* **Slack user?** [Join our community](https://slack.count.ly) to ask questions and get answers!
|
|
10
|
+
* **Questions?** [Ask in our Community forum](https://support.count.ly/hc/en-us/community/topics)
|
|
11
|
+
|
|
12
|
+
## Implementing Countly SDK in your web pages
|
|
13
|
+
|
|
14
|
+
There are 3 ways to get Countly SDK.
|
|
15
|
+
|
|
16
|
+
### 1. Available with Countly server
|
|
17
|
+
Since Countly server 16.02, Countly Web SDK is available in your Countly server installation in `countly/frontend/express/public/sdk/web/countly.min.js` which should be available through URL as `https://yourserver.com/sdk/web/countly.min.js`
|
|
18
|
+
|
|
19
|
+
### 2. Installation using package managers
|
|
20
|
+
|
|
21
|
+
bower install countly-sdk-web
|
|
22
|
+
or
|
|
23
|
+
|
|
24
|
+
npm install countly-sdk-web
|
|
25
|
+
or
|
|
26
|
+
|
|
27
|
+
yarn add countly-sdk-web
|
|
28
|
+
|
|
29
|
+
### 3. Use a CDN (content delivery network)
|
|
30
|
+
|
|
31
|
+
Countly web SDK is available on CDNJS. Use either
|
|
32
|
+
|
|
33
|
+
[https://cdnjs.cloudflare.com/ajax/libs/countly-sdk-web/22.02.3/countly.min.js](https://cdnjs.cloudflare.com/ajax/libs/countly-sdk-web/22.02.3/countly.min.js)
|
|
34
|
+
|
|
35
|
+
or
|
|
36
|
+
|
|
37
|
+
[https://cdn.jsdelivr.net/npm/countly-sdk-web@latest/lib/countly.min.js](https://cdn.jsdelivr.net/npm/countly-sdk-web@latest/lib/countly.min.js)
|
|
38
|
+
|
|
39
|
+
## How to use Countly Web SDK?
|
|
40
|
+
|
|
41
|
+
Link to the script and call helper methods based on what you want to track: sessions, views, clicks, custom events, user data, etc. and for much more information check out our documentation at [https://support.count.ly/hc/en-us/articles/360037441932-Web-analytics-JavaScript-](https://support.count.ly/hc/en-us/articles/360037441932-Web-analytics-JavaScript-)
|
|
42
|
+
|
|
43
|
+
You can reach minimal integration info for your website from here [https://support.count.ly/hc/en-us/articles/360037441932-Web-analytics-JavaScript-#minimal-setup](https://support.count.ly/hc/en-us/articles/360037441932-Web-analytics-JavaScript-#minimal-setup)
|
|
44
|
+
|
|
45
|
+
Countly Web SDK has JSDoc3 compatible comments and you can generate documentation by running `npm run-script docs` or access online version at [https://countly.github.io/countly-sdk-web/](https://countly.github.io/countly-sdk-web/)
|
|
46
|
+
|
|
47
|
+
## Security
|
|
48
|
+
|
|
49
|
+
Security is very important to us. If you discover any issue regarding security, please disclose the information responsibly by sending an email to security@count.ly and **not by creating a GitHub issue**.
|
|
50
|
+
|
|
51
|
+
## Other Github resources
|
|
52
|
+
|
|
53
|
+
Check Countly Community Edition source code here:
|
|
54
|
+
|
|
55
|
+
- [Countly Server](https://github.com/Countly/countly-server)
|
|
56
|
+
|
|
57
|
+
There are also other Countly SDK repositories below:
|
|
58
|
+
|
|
59
|
+
- [Countly iOS SDK](https://github.com/Countly/countly-sdk-ios)
|
|
60
|
+
- [Countly Android SDK](https://github.com/Countly/countly-sdk-android)
|
|
61
|
+
- [Countly Windows Phone SDK](https://github.com/Countly/countly-sdk-windows-phone)
|
|
62
|
+
- [Countly Appcelerator Titanium SDK](https://github.com/euforic/Titanium-Count.ly) (Community supported)
|
|
63
|
+
- [Countly Unity3D SDK](https://github.com/Countly/countly-sdk-unity) (Community supported)
|
|
64
|
+
|
|
65
|
+
## How can I help you with your efforts?
|
|
66
|
+
|
|
67
|
+
Glad you asked. We need ideas, feedbacks and constructive comments. All your suggestions will be taken care with upmost importance. We are on [Twitter](http://twitter.com/gocountly) and [Facebook](https://www.facebook.com/Countly) if you would like to keep up with our fast progress!
|
|
68
|
+
|
|
69
|
+
## Badges
|
|
70
|
+
|
|
71
|
+
If you like Countly, [why not use one of our badges](https://count.ly/brand-assets) and give a link back to us, so others know about this wonderful platform?
|
|
72
|
+
|
|
73
|
+
<a href="https://count.ly/f/badge" rel="nofollow"><img style="width:145px;height:60px" src="https://count.ly/badges/dark.svg?v2" alt="Countly - Product Analytics" /></a>
|
|
74
|
+
|
|
75
|
+
<a href="https://count.ly/f/badge" rel="nofollow"><img style="width:145px;height:60px" src="https://count.ly/badges/dark.svg" alt="Countly - Product Analytics" /></a>
|
|
76
|
+
|
|
77
|
+
<a href="https://count.ly/f/badge" rel="nofollow"><img style="width:145px;height:60px" src="https://count.ly/badges/light.svg?v2" alt="Countly - Product Analytics" /></a>
|
|
78
|
+
|
|
79
|
+
<a href="https://count.ly/f/badge" rel="nofollow"><img style="width:145px;height:60px" src="https://count.ly/badges/light.svg" alt="Countly - Product Analytics" /></a>
|
|
80
|
+
|
|
81
|
+
## Support
|
|
82
|
+
|
|
83
|
+
For a public community support page, visit [https://support.count.ly/hc/en-us/community/topics](https://support.count.ly/hc/en-us/community/topics "Countly Community Forum").
|
|
84
|
+
|
|
85
|
+
[](https://nodei.co/npm/countly-sdk-web/)
|
|
86
|
+
|
package/SECURITY.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
Security is very important to us. If you discover any issue regarding security, please disclose the information responsibly by sending an email to security@count.ly and not by creating a GitHub issue.
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
Security is very important to us. If you discover any issue regarding security, please disclose the information responsibly by sending an email to security@count.ly and not by creating a GitHub issue.
|
package/bower.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "countly-sdk-web",
|
|
3
|
-
"version": "19.2.0",
|
|
4
|
-
"description": "Countly Web SDK",
|
|
5
|
-
"main": "lib/countly.js",
|
|
6
|
-
"moduleType": "globals",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"Countly",
|
|
9
|
-
"Analytics",
|
|
10
|
-
"Web",
|
|
11
|
-
"Mobile"
|
|
12
|
-
],
|
|
13
|
-
"authors": [
|
|
14
|
-
"Countly"
|
|
15
|
-
],
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git://github.com/countly/countly-sdk-web.git"
|
|
19
|
-
},
|
|
20
|
-
"license": "./LICENSE",
|
|
21
|
-
"homepage": "https://count.ly/",
|
|
22
|
-
"ignore": [
|
|
23
|
-
"**/.*",
|
|
24
|
-
"node_modules",
|
|
25
|
-
"bower_components",
|
|
26
|
-
"test",
|
|
27
|
-
"tests"
|
|
28
|
-
]
|
|
29
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "countly-sdk-web",
|
|
3
|
+
"version": "19.2.0",
|
|
4
|
+
"description": "Countly Web SDK",
|
|
5
|
+
"main": "lib/countly.js",
|
|
6
|
+
"moduleType": "globals",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"Countly",
|
|
9
|
+
"Analytics",
|
|
10
|
+
"Web",
|
|
11
|
+
"Mobile"
|
|
12
|
+
],
|
|
13
|
+
"authors": [
|
|
14
|
+
"Countly"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git://github.com/countly/countly-sdk-web.git"
|
|
19
|
+
},
|
|
20
|
+
"license": "./LICENSE",
|
|
21
|
+
"homepage": "https://count.ly/",
|
|
22
|
+
"ignore": [
|
|
23
|
+
"**/.*",
|
|
24
|
+
"node_modules",
|
|
25
|
+
"bower_components",
|
|
26
|
+
"test",
|
|
27
|
+
"tests"
|
|
28
|
+
]
|
|
29
|
+
}
|
package/cypress/.eslintrc.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
plugins: [
|
|
3
|
-
"cypress"
|
|
4
|
-
],
|
|
5
|
-
parserOptions: {
|
|
6
|
-
ecmaVersion: 6
|
|
7
|
-
},
|
|
8
|
-
rules: {
|
|
9
|
-
"cypress/no-assigning-return-values": "error",
|
|
10
|
-
"cypress/no-unnecessary-waiting": "off",
|
|
11
|
-
"cypress/assertion-before-screenshot": "warn",
|
|
12
|
-
"cypress/no-force": "warn",
|
|
13
|
-
"cypress/no-async-tests": "error",
|
|
14
|
-
"cypress/no-pause": "error"
|
|
15
|
-
},
|
|
16
|
-
env: {
|
|
17
|
-
"cypress/globals": true
|
|
18
|
-
},
|
|
19
|
-
extends: [
|
|
20
|
-
"plugin:cypress/recommended",
|
|
21
|
-
"plugin:chai-friendly/recommended"
|
|
22
|
-
],
|
|
1
|
+
module.exports = {
|
|
2
|
+
plugins: [
|
|
3
|
+
"cypress"
|
|
4
|
+
],
|
|
5
|
+
parserOptions: {
|
|
6
|
+
ecmaVersion: 6
|
|
7
|
+
},
|
|
8
|
+
rules: {
|
|
9
|
+
"cypress/no-assigning-return-values": "error",
|
|
10
|
+
"cypress/no-unnecessary-waiting": "off",
|
|
11
|
+
"cypress/assertion-before-screenshot": "warn",
|
|
12
|
+
"cypress/no-force": "warn",
|
|
13
|
+
"cypress/no-async-tests": "error",
|
|
14
|
+
"cypress/no-pause": "error"
|
|
15
|
+
},
|
|
16
|
+
env: {
|
|
17
|
+
"cypress/globals": true
|
|
18
|
+
},
|
|
19
|
+
extends: [
|
|
20
|
+
"plugin:cypress/recommended",
|
|
21
|
+
"plugin:chai-friendly/recommended"
|
|
22
|
+
],
|
|
23
23
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<script type='text/javascript' src='../../lib/countly.js'></script>
|
|
4
|
+
<script type='text/javascript'>
|
|
5
|
+
// here we implement a cookie and localStorage clearing logic
|
|
6
|
+
const deleteAllCookies = () => {
|
|
7
|
+
const cookies = document.cookie.split(";");
|
|
8
|
+
for (const cookie of cookies) {
|
|
9
|
+
const eqPos = cookie.indexOf("=");
|
|
10
|
+
const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
|
|
11
|
+
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
window.localStorage.clear();
|
|
15
|
+
deleteAllCookies();
|
|
16
|
+
console.error("cleared the storage");
|
|
17
|
+
Countly.init({
|
|
18
|
+
app_key: "YOUR_APP_KEY",
|
|
19
|
+
url: "https://try.count.ly",
|
|
20
|
+
debug:true,
|
|
21
|
+
test_mode: true
|
|
22
|
+
})
|
|
23
|
+
Countly.track_sessions();
|
|
24
|
+
Countly.track_pageview();
|
|
25
|
+
Countly.track_scrolls();
|
|
26
|
+
</script>
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<h1>page1</h1>
|
|
30
|
+
<h2>text</h2>
|
|
31
|
+
<h3>text</h3>
|
|
32
|
+
<h4>text</h4>
|
|
33
|
+
<h5>text</h5>
|
|
34
|
+
<h6>text</h6>
|
|
35
|
+
<h1>text</h1>
|
|
36
|
+
<h2>text</h2>
|
|
37
|
+
<h3>text</h3>
|
|
38
|
+
<h4>text</h4>
|
|
39
|
+
<h5>text</h5>
|
|
40
|
+
<h6>text</h6>
|
|
41
|
+
<h1>text</h1>
|
|
42
|
+
<h2>text</h2>
|
|
43
|
+
<h3>text</h3>
|
|
44
|
+
<h4>text</h4>
|
|
45
|
+
<h5>text</h5>
|
|
46
|
+
<h6>text</h6>
|
|
47
|
+
<h1>text</h1>
|
|
48
|
+
<h2>text</h2>
|
|
49
|
+
<h3>text</h3>
|
|
50
|
+
<h4>text</h4>
|
|
51
|
+
<h5>text</h5>
|
|
52
|
+
<h6>text</h6>
|
|
53
|
+
<h1>text</h1>
|
|
54
|
+
<h2>text</h2>
|
|
55
|
+
<h3>text</h3>
|
|
56
|
+
<h4>text</h4>
|
|
57
|
+
<h5>text</h5>
|
|
58
|
+
<h6>text</h6>
|
|
59
|
+
</body>
|
|
60
|
+
</html>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<script type='text/javascript' src='../../lib/countly.js'></script>
|
|
4
|
+
<script type='text/javascript'>
|
|
5
|
+
Countly.init({
|
|
6
|
+
app_key: "YOUR_APP_KEY",
|
|
7
|
+
url: "https://try.count.ly",
|
|
8
|
+
debug:true,
|
|
9
|
+
test_mode: true
|
|
10
|
+
})
|
|
11
|
+
Countly.track_sessions();
|
|
12
|
+
Countly.track_pageview();
|
|
13
|
+
Countly.track_scrolls();
|
|
14
|
+
</script>
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<h1>page2</h1>
|
|
18
|
+
<h2>text</h2>
|
|
19
|
+
<h3>text</h3>
|
|
20
|
+
<h4>text</h4>
|
|
21
|
+
<h5>text</h5>
|
|
22
|
+
<h6>text</h6>
|
|
23
|
+
<h1>text</h1>
|
|
24
|
+
<h2>text</h2>
|
|
25
|
+
<h3>text</h3>
|
|
26
|
+
<h4>text</h4>
|
|
27
|
+
<h5>text</h5>
|
|
28
|
+
<h6>text</h6>
|
|
29
|
+
<h1>text</h1>
|
|
30
|
+
<h2>text</h2>
|
|
31
|
+
<h3>text</h3>
|
|
32
|
+
<h4>text</h4>
|
|
33
|
+
<h5>text</h5>
|
|
34
|
+
<h6>text</h6>
|
|
35
|
+
<h1>text</h1>
|
|
36
|
+
<h2>text</h2>
|
|
37
|
+
<h3>text</h3>
|
|
38
|
+
<h4>text</h4>
|
|
39
|
+
<h5>text</h5>
|
|
40
|
+
<h6>text</h6>
|
|
41
|
+
<h1>text</h1>
|
|
42
|
+
<h2>text</h2>
|
|
43
|
+
<h3>text</h3>
|
|
44
|
+
<h4>text</h4>
|
|
45
|
+
<h5>text</h5>
|
|
46
|
+
<h6>text</h6>
|
|
47
|
+
</body>
|
|
48
|
+
</html>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<script type='text/javascript' src='../../lib/countly.js'></script>
|
|
4
|
+
<script type='text/javascript'>
|
|
5
|
+
// here we implement a cookie and localStorage clearing logic
|
|
6
|
+
const deleteAllCookies = () => {
|
|
7
|
+
const cookies = document.cookie.split(";");
|
|
8
|
+
for (const cookie of cookies) {
|
|
9
|
+
const eqPos = cookie.indexOf("=");
|
|
10
|
+
const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
|
|
11
|
+
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
window.localStorage.clear();
|
|
15
|
+
deleteAllCookies();
|
|
16
|
+
console.error("cleared the storage");
|
|
17
|
+
Countly.init({
|
|
18
|
+
app_key: "YOUR_APP_KEY",
|
|
19
|
+
url: "https://try.count.ly",
|
|
20
|
+
debug:true,
|
|
21
|
+
test_mode: true
|
|
22
|
+
})
|
|
23
|
+
Countly.track_sessions();
|
|
24
|
+
Countly.track_pageview();
|
|
25
|
+
Countly.track_scrolls();
|
|
26
|
+
</script>
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<script type='text/javascript'>
|
|
30
|
+
function view1(){
|
|
31
|
+
Countly.track_pageview("v1");
|
|
32
|
+
console.log("scroll test, v1 triggered");
|
|
33
|
+
}
|
|
34
|
+
function view2(){
|
|
35
|
+
Countly.track_pageview("v2");
|
|
36
|
+
console.log("scroll test, v2 triggered");
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
<input type="button" id="b1" onclick="view1()" >
|
|
40
|
+
<input type="button" id="b2" onclick="view2()" >
|
|
41
|
+
<h1>page3</h1>
|
|
42
|
+
<h2>text</h2>
|
|
43
|
+
<h3>text</h3>
|
|
44
|
+
<h4>text</h4>
|
|
45
|
+
<h5>text</h5>
|
|
46
|
+
<h6>text</h6>
|
|
47
|
+
<h1>text</h1>
|
|
48
|
+
<h2>text</h2>
|
|
49
|
+
<h3>text</h3>
|
|
50
|
+
<h4>text</h4>
|
|
51
|
+
<h5>text</h5>
|
|
52
|
+
<h6>text</h6>
|
|
53
|
+
<h1>text</h1>
|
|
54
|
+
<h2>text</h2>
|
|
55
|
+
<h3>text</h3>
|
|
56
|
+
<h4>text</h4>
|
|
57
|
+
<h5>text</h5>
|
|
58
|
+
<h6>text</h6>
|
|
59
|
+
<h1>text</h1>
|
|
60
|
+
<h2>text</h2>
|
|
61
|
+
<h3>text</h3>
|
|
62
|
+
<h4>text</h4>
|
|
63
|
+
<h5>text</h5>
|
|
64
|
+
<h6>text</h6>
|
|
65
|
+
<h1>text</h1>
|
|
66
|
+
<h2>text</h2>
|
|
67
|
+
<h3>text</h3>
|
|
68
|
+
<h4>text</h4>
|
|
69
|
+
<h5>text</h5>
|
|
70
|
+
<h6>text</h6>
|
|
71
|
+
</body>
|
|
72
|
+
</html>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<!--Here we have automatic session tracking-->
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<!--Countly script-->
|
|
5
|
+
<script type='text/javascript' src='../../lib/countly.js'></script>
|
|
6
|
+
<script type='text/javascript' src='../support/integration_helper.js'></script>
|
|
7
|
+
<script type='text/javascript'>
|
|
8
|
+
// here we implement a cookie and localStorage clearing logic
|
|
9
|
+
const deleteAllCookies = () => {
|
|
10
|
+
const cookies = document.cookie.split(";");
|
|
11
|
+
for (const cookie of cookies) {
|
|
12
|
+
const eqPos = cookie.indexOf("=");
|
|
13
|
+
const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
|
|
14
|
+
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
window.localStorage.clear();
|
|
18
|
+
deleteAllCookies();
|
|
19
|
+
console.error("cleared the storage");
|
|
20
|
+
|
|
21
|
+
// we extract the url query and dissect the embedded configuration object within
|
|
22
|
+
const confObj = queryExtractor(window.location.search);
|
|
23
|
+
|
|
24
|
+
//initializing countly with params
|
|
25
|
+
Countly.init({
|
|
26
|
+
app_key: "YOUR_APP_KEY",
|
|
27
|
+
url: "https://try.count.ly",
|
|
28
|
+
device_id: "auto",
|
|
29
|
+
session_update: 5,
|
|
30
|
+
test_mode: true,
|
|
31
|
+
use_session_cookie: confObj.use_session_cookie || false,
|
|
32
|
+
debug:true
|
|
33
|
+
})
|
|
34
|
+
Countly.track_sessions();
|
|
35
|
+
// Countly.track_pageview();
|
|
36
|
+
</script>
|
|
37
|
+
</head>
|
|
38
|
+
<body>
|
|
39
|
+
<script type='text/javascript' >
|
|
40
|
+
function clickEvent(){
|
|
41
|
+
Countly.add_event({
|
|
42
|
+
key: "buttonClick",
|
|
43
|
+
"segmentation": {
|
|
44
|
+
"id": "id"
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
<button type="button" onclick="clickEvent()">Event</button>
|
|
50
|
+
</body>
|
|
51
|
+
</html>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!--Here we have manual session tracking with buttons-->
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<!--Countly script-->
|
|
5
|
+
<script type='text/javascript' src='../../lib/countly.js'></script>
|
|
6
|
+
<script type='text/javascript' src='../support/integration_helper.js'></script>
|
|
7
|
+
<script type='text/javascript'>
|
|
8
|
+
// here we implement a cookie and localStorage clearing logic
|
|
9
|
+
const deleteAllCookies = () => {
|
|
10
|
+
const cookies = document.cookie.split(";");
|
|
11
|
+
for (const cookie of cookies) {
|
|
12
|
+
const eqPos = cookie.indexOf("=");
|
|
13
|
+
const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
|
|
14
|
+
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
window.localStorage.clear();
|
|
18
|
+
deleteAllCookies();
|
|
19
|
+
console.error("cleared the storage");
|
|
20
|
+
|
|
21
|
+
// we extract the url query and dissect the embedded configuration object within
|
|
22
|
+
const confObj = queryExtractor(window.location.search);
|
|
23
|
+
|
|
24
|
+
//initializing countly with params
|
|
25
|
+
Countly.init({
|
|
26
|
+
app_key: "YOUR_APP_KEY",
|
|
27
|
+
url: "https://try.count.ly",
|
|
28
|
+
device_id: "manual_1",
|
|
29
|
+
session_update: 5,
|
|
30
|
+
test_mode: true,
|
|
31
|
+
use_session_cookie: confObj.use_session_cookie || false,
|
|
32
|
+
debug:true
|
|
33
|
+
})
|
|
34
|
+
</script>
|
|
35
|
+
</head>
|
|
36
|
+
<body>
|
|
37
|
+
<script type='text/javascript' >
|
|
38
|
+
function clickEvent(){
|
|
39
|
+
Countly.add_event({
|
|
40
|
+
key: "buttonClick",
|
|
41
|
+
"segmentation": {
|
|
42
|
+
"id": "id"
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function start(){
|
|
47
|
+
Countly.begin_session();
|
|
48
|
+
}
|
|
49
|
+
function end(){
|
|
50
|
+
Countly.end_session();
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
53
|
+
<button type="button" onclick="clickEvent()">Event</button>
|
|
54
|
+
<button type="button" onclick="start()">Start</button>
|
|
55
|
+
<button type="button" onclick="end()">End</button>
|
|
56
|
+
<button type="button" onclick="windowClose()">Close</button>
|
|
57
|
+
</body>
|
|
58
|
+
</html>
|