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.
Files changed (91) hide show
  1. package/.eslintignore +17 -17
  2. package/.eslintrc.js +215 -215
  3. package/.github/dependabot.yml +20 -20
  4. package/.github/workflows/codeql-analysis.yml +71 -71
  5. package/.github/workflows/documentation.yml +24 -0
  6. package/.github/workflows/node.js.yml +25 -41
  7. package/CHANGELOG.md +241 -237
  8. package/LICENSE +19 -19
  9. package/README.md +86 -122
  10. package/SECURITY.md +3 -3
  11. package/bower.json +29 -29
  12. package/cypress/.eslintrc.js +22 -22
  13. package/cypress/fixtures/base.html +8 -0
  14. package/cypress/fixtures/scroll_test.html +60 -0
  15. package/cypress/fixtures/scroll_test_2.html +48 -0
  16. package/cypress/fixtures/scroll_test_3.html +72 -0
  17. package/cypress/fixtures/session_test_auto.html +51 -0
  18. package/cypress/fixtures/session_test_manual_1.html +58 -0
  19. package/cypress/fixtures/session_test_manual_2.html +54 -0
  20. package/cypress/fixtures/user_agent.html +20 -0
  21. package/cypress/integration/consents.js +165 -165
  22. package/cypress/integration/device_id.js +1085 -830
  23. package/cypress/integration/events.js +65 -65
  24. package/cypress/integration/heatmaps.js +52 -0
  25. package/cypress/integration/internal_limits.js +153 -153
  26. package/cypress/integration/reponse_validation.js +170 -170
  27. package/cypress/integration/sessions.js +196 -60
  28. package/cypress/integration/user_agent.js +63 -0
  29. package/cypress/integration/user_details.js +40 -40
  30. package/cypress/integration/utm.js +236 -236
  31. package/cypress/integration/views.js +62 -62
  32. package/cypress/plugins/index.js +22 -22
  33. package/cypress/support/commands.js +322 -298
  34. package/cypress/support/helper.js +59 -59
  35. package/cypress/support/index.js +2 -2
  36. package/cypress/support/integration_helper.js +17 -0
  37. package/cypress.json +3 -1
  38. package/examples/example_apm.html +51 -51
  39. package/examples/example_fb.html +50 -50
  40. package/examples/example_formdata.html +47 -47
  41. package/examples/example_ga_adapter.html +173 -173
  42. package/examples/example_gdpr.html +82 -82
  43. package/examples/example_internal_limits.html +184 -184
  44. package/examples/example_multiple_instances.html +52 -52
  45. package/examples/example_rating_widgets.html +80 -80
  46. package/examples/example_remote_config.html +38 -38
  47. package/examples/example_sync.html +36 -36
  48. package/examples/examples_feedback_widgets.html +81 -81
  49. package/examples/mpa/boomerang/boomerang-1.0.0.js +22871 -22871
  50. package/examples/mpa/boomerang/countly_boomerang.js +138 -138
  51. package/examples/mpa/index.html +816 -816
  52. package/examples/react/README.md +35 -35
  53. package/examples/react/package.json +37 -37
  54. package/examples/react/public/index.html +19 -19
  55. package/examples/react/public/manifest.json +25 -25
  56. package/examples/react/public/robots.txt +3 -3
  57. package/examples/react/src/App-WithEffect.js +33 -33
  58. package/examples/react/src/App-WithRouter.js +46 -46
  59. package/examples/react/src/App.test.js +9 -9
  60. package/examples/react/src/Components/Contact.js +28 -28
  61. package/examples/react/src/Components/Header.js +88 -88
  62. package/examples/react/src/Components/Home.js +23 -23
  63. package/examples/react/src/Components/Users.js +43 -43
  64. package/examples/react/src/Components/styles.css +25 -25
  65. package/examples/react/src/ErrorBoundary.js +28 -28
  66. package/examples/react/src/Location-WithEffect.js +27 -27
  67. package/examples/react/src/Location-WithRouter.js +23 -23
  68. package/examples/react/src/index.css +5 -5
  69. package/examples/react/src/index.js +68 -68
  70. package/examples/react/src/serviceWorker.js +141 -141
  71. package/examples/react/src/setupTests.js +5 -5
  72. package/examples/symbolication/.babelrc +11 -11
  73. package/examples/symbolication/.editorconfig +8 -8
  74. package/examples/symbolication/.yo-rc.json +53 -53
  75. package/examples/symbolication/README.md +33 -33
  76. package/examples/symbolication/package.json +22 -22
  77. package/examples/symbolication/src/index.js +47 -47
  78. package/examples/symbolication/static/index.html +21 -21
  79. package/examples/symbolication/webpack.config.js +27 -27
  80. package/generateDocs.sh +80 -79
  81. package/inch.json +6 -6
  82. package/jsdoc_conf.json +4 -2
  83. package/lib/countly.js +4625 -4416
  84. package/lib/countly.min.js +126 -117
  85. package/package.json +57 -57
  86. package/plugin/boomerang/boomerang.min.js +10 -10
  87. package/plugin/boomerang/countly_boomerang.js +150 -150
  88. package/plugin/ga_adapter/doc.md +73 -73
  89. package/plugin/ga_adapter/ga_adapter.js +451 -451
  90. package/webpack.config.js +12 -12
  91. package/countly-sdk-web-22.2.2.tgz +0 -0
@@ -1,38 +1,38 @@
1
- <html>
2
- <head>
3
- <input type="button" onclick="reloadConfig()" value="Reload Config">
4
- <input type="button" onclick="getConfig()" value="Get Config">
5
- <input type="button" onclick="getConfig('test')" value="Get config for key Test">
6
- <p><a href='http://count.ly/'>Count.ly</a></p>
7
- <!--Countly script-->
8
- <script type='text/javascript' src='../lib/countly.js'></script>
9
- <script type='text/javascript'>
10
-
11
- //initializing countly with params and remote config
12
- Countly.init({
13
- app_key: "YOUR_APP_KEY",
14
- url: "https://try.count.ly", //your server goes here
15
- debug:true,
16
- remote_config: function(err, configs){
17
- //handle initial remote configs here
18
- console.log(err, configs);
19
- }
20
- })
21
- </script>
22
- </head>
23
- <body>
24
- <script type='text/javascript'>
25
- //reload configs
26
- function reloadConfig(ob){
27
- Countly.fetch_remote_config(function(err, config){
28
- alert(JSON.stringify(config));
29
- });
30
- }
31
-
32
- //get config
33
- function getConfig(key){
34
- alert(JSON.stringify(Countly.get_remote_config(key)));
35
- }
36
- </script>
37
- </body>
38
- </html>
1
+ <html>
2
+ <head>
3
+ <input type="button" onclick="reloadConfig()" value="Reload Config">
4
+ <input type="button" onclick="getConfig()" value="Get Config">
5
+ <input type="button" onclick="getConfig('test')" value="Get config for key Test">
6
+ <p><a href='http://count.ly/'>Count.ly</a></p>
7
+ <!--Countly script-->
8
+ <script type='text/javascript' src='../lib/countly.js'></script>
9
+ <script type='text/javascript'>
10
+
11
+ //initializing countly with params and remote config
12
+ Countly.init({
13
+ app_key: "YOUR_APP_KEY",
14
+ url: "https://try.count.ly", //your server goes here
15
+ debug:true,
16
+ remote_config: function(err, configs){
17
+ //handle initial remote configs here
18
+ console.log(err, configs);
19
+ }
20
+ })
21
+ </script>
22
+ </head>
23
+ <body>
24
+ <script type='text/javascript'>
25
+ //reload configs
26
+ function reloadConfig(ob){
27
+ Countly.fetch_remote_config(function(err, config){
28
+ alert(JSON.stringify(config));
29
+ });
30
+ }
31
+
32
+ //get config
33
+ function getConfig(key){
34
+ alert(JSON.stringify(Countly.get_remote_config(key)));
35
+ }
36
+ </script>
37
+ </body>
38
+ </html>
@@ -1,36 +1,36 @@
1
- <html>
2
- <head>
3
- <input type="button" id="testButton" onclick="clickEvent()" value="Test Button">
4
- <p><a href='http://count.ly/'>Count.ly</a></p>
5
- <!--Countly script-->
6
- <script type='text/javascript' src='../lib/countly.js'></script>
7
- <script type='text/javascript'>
8
-
9
- //initializing countly with params
10
- Countly.init({
11
- app_key: "YOUR_APP_KEY",
12
- url: "https://try.count.ly", //your server goes here
13
- debug:true,
14
- offline_mode: true
15
- })
16
- //track sessions automatically
17
- Countly.track_sessions();
18
- //track pageviews automatically
19
- Countly.track_pageview();
20
- Countly.track_errors();
21
- </script>
22
- </head>
23
- <body>
24
- <script type='text/javascript' >
25
- //send event on button click
26
- function clickEvent(){
27
- Countly.add_event({
28
- key: "buttonClick",
29
- "segmentation": {
30
- "id": "id"
31
- }
32
- });
33
- }
34
- </script>
35
- </body>
36
- </html>
1
+ <html>
2
+ <head>
3
+ <input type="button" id="testButton" onclick="clickEvent()" value="Test Button">
4
+ <p><a href='http://count.ly/'>Count.ly</a></p>
5
+ <!--Countly script-->
6
+ <script type='text/javascript' src='../lib/countly.js'></script>
7
+ <script type='text/javascript'>
8
+
9
+ //initializing countly with params
10
+ Countly.init({
11
+ app_key: "YOUR_APP_KEY",
12
+ url: "https://try.count.ly", //your server goes here
13
+ debug:true,
14
+ offline_mode: true
15
+ })
16
+ //track sessions automatically
17
+ Countly.track_sessions();
18
+ //track pageviews automatically
19
+ Countly.track_pageview();
20
+ Countly.track_errors();
21
+ </script>
22
+ </head>
23
+ <body>
24
+ <script type='text/javascript' >
25
+ //send event on button click
26
+ function clickEvent(){
27
+ Countly.add_event({
28
+ key: "buttonClick",
29
+ "segmentation": {
30
+ "id": "id"
31
+ }
32
+ });
33
+ }
34
+ </script>
35
+ </body>
36
+ </html>
@@ -1,81 +1,81 @@
1
- <html>
2
- <head>
3
- <!--Countly script-->
4
- <script type='text/javascript' src='../lib/countly.js'></script>
5
- <script type='text/javascript'>
6
-
7
- //initializing Countly with params and passing require_consent config as true as feedback widget depends on consent
8
- Countly.init({
9
- app_key: 'YOUR_APP_ID', //your app key
10
- url: 'https://try.count.ly', //your server goes here
11
- debug:true,
12
- require_consent: true //this true means consent is required
13
- });
14
-
15
-
16
- //some general helper methods can be initiated here like:
17
- // Countly.track_sessions();
18
- // Countly.track_pageview();
19
-
20
-
21
- //Consent Management logic should be implemented and controlled by developer
22
- //this is just a simply example of what logic it could have
23
- if (typeof(localStorage) !== "undefined") {
24
- var consents = localStorage.getItem("consents");
25
- //checking if user already provided consent
26
- if(consents){
27
- //we already have consents from previous visit, let's just pass them to Countly
28
- Countly.add_consent(JSON.parse(consents));
29
-
30
- }
31
- else{
32
- //user have not yet provided us a consent
33
- //we need to display popup and ask user to give consent for specific features we want to track
34
- //for example purposes, we will wait till user clicks "Give Consent" button
35
- //to allow consent for enabling feedback widget
36
- }
37
- } else {
38
- // Sorry! No Web Storage support..
39
- // we can fallback to cookie
40
- }
41
-
42
-
43
-
44
- function giveConsent(){
45
- //give consent for feedback widgets to work
46
- var response = ["feedback"];
47
- Countly.add_consent(response);
48
- localStorage.setItem("consents", JSON.stringify(response));
49
- }
50
-
51
- function enable(){
52
- //Fetch user's NPS and Survey feedbacks from the server
53
- Countly.get_available_feedback_widgets(feedbackWidgetsCallback);
54
- }
55
-
56
- //Surveys feedback callback function
57
- function feedbackWidgetsCallback(countlyPresentableFeedback, err) {
58
- if (err) {
59
- console.log(err);
60
- return;
61
- }
62
- //The available feedback types are nps and survey, decide which one to show
63
- var countlyFeedbackWidget = countlyPresentableFeedback;
64
-
65
- //Define the element ID and the class name, optional
66
- var selectorId = "";
67
- var selectorClass = "";
68
-
69
- //Display the feedback widget to the end user
70
- Countly.present_feedback_widget(countlyFeedbackWidget, selectorId, selectorClass);
71
- }
72
-
73
-
74
- </script>
75
- </head>
76
- <body>
77
- <p><a href='http://count.ly/'>Count.ly</a></p>
78
- <p><button onclick="giveConsent()">Give Feedback Consent</button></p>
79
- <p><button onclick="enable()">Enable Feedback Widget</button></p>
80
- </body>
81
- </html>
1
+ <html>
2
+ <head>
3
+ <!--Countly script-->
4
+ <script type='text/javascript' src='../lib/countly.js'></script>
5
+ <script type='text/javascript'>
6
+
7
+ //initializing Countly with params and passing require_consent config as true as feedback widget depends on consent
8
+ Countly.init({
9
+ app_key: 'YOUR_APP_ID', //your app key
10
+ url: 'https://try.count.ly', //your server goes here
11
+ debug:true,
12
+ require_consent: true //this true means consent is required
13
+ });
14
+
15
+
16
+ //some general helper methods can be initiated here like:
17
+ // Countly.track_sessions();
18
+ // Countly.track_pageview();
19
+
20
+
21
+ //Consent Management logic should be implemented and controlled by developer
22
+ //this is just a simply example of what logic it could have
23
+ if (typeof(localStorage) !== "undefined") {
24
+ var consents = localStorage.getItem("consents");
25
+ //checking if user already provided consent
26
+ if(consents){
27
+ //we already have consents from previous visit, let's just pass them to Countly
28
+ Countly.add_consent(JSON.parse(consents));
29
+
30
+ }
31
+ else{
32
+ //user have not yet provided us a consent
33
+ //we need to display popup and ask user to give consent for specific features we want to track
34
+ //for example purposes, we will wait till user clicks "Give Consent" button
35
+ //to allow consent for enabling feedback widget
36
+ }
37
+ } else {
38
+ // Sorry! No Web Storage support..
39
+ // we can fallback to cookie
40
+ }
41
+
42
+
43
+
44
+ function giveConsent(){
45
+ //give consent for feedback widgets to work
46
+ var response = ["feedback"];
47
+ Countly.add_consent(response);
48
+ localStorage.setItem("consents", JSON.stringify(response));
49
+ }
50
+
51
+ function enable(){
52
+ //Fetch user's NPS and Survey feedbacks from the server
53
+ Countly.get_available_feedback_widgets(feedbackWidgetsCallback);
54
+ }
55
+
56
+ //Surveys feedback callback function
57
+ function feedbackWidgetsCallback(countlyPresentableFeedback, err) {
58
+ if (err) {
59
+ console.log(err);
60
+ return;
61
+ }
62
+ //The available feedback types are nps and survey, decide which one to show
63
+ var countlyFeedbackWidget = countlyPresentableFeedback;
64
+
65
+ //Define the element ID and the class name, optional
66
+ var selectorId = "";
67
+ var selectorClass = "";
68
+
69
+ //Display the feedback widget to the end user
70
+ Countly.present_feedback_widget(countlyFeedbackWidget, selectorId, selectorClass);
71
+ }
72
+
73
+
74
+ </script>
75
+ </head>
76
+ <body>
77
+ <p><a href='http://count.ly/'>Count.ly</a></p>
78
+ <p><button onclick="giveConsent()">Give Feedback Consent</button></p>
79
+ <p><button onclick="enable()">Enable Feedback Widget</button></p>
80
+ </body>
81
+ </html>