appscms-tools-theme 3.6.5 → 3.6.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36d488483ee5d1b735b86ebc901aae7adb729d7f7ad8f18e8164ca6c986b139f
4
- data.tar.gz: 8889d60e343a560c48a4e6f90494aa74da1ec4651e542a350ec9a5a46dc1076c
3
+ metadata.gz: 54025741868d133ecbdcfd5d563abfa8c02f80b48fd1387abd564e4fac836f46
4
+ data.tar.gz: bfca025ac2fed0ded5ab34a2f7ab02729a2ec67380414a4cfef53f4049e9b978
5
5
  SHA512:
6
- metadata.gz: f6b8f074625645bf6e4e41380509499f590062091f5e18cdbaacc2466d6f20d4f13ed61c2376de5de2d5c9c67f8e5baabd06d3342fbcbba60565402924e94ef0
7
- data.tar.gz: f2b13a5e654c4462e2da34573ae544cc9b9427ed7825d3a73909ead09f9f80ac19e8436de89fd4134333fc4bc6f2c37470f58935631105f559738dca3c348d59
6
+ metadata.gz: 3b261cec09acc02f6b7e1b237de84d73fb20564d9513a86bd8bd4720f99a77a1fb39af477517cf722aa858b64c376ccbcf94a14a27ae6519a936fd1c350da716
7
+ data.tar.gz: 79ac73ef06575e7bcda7f38cb0951b15b2609477d0fc87b5f8f1cfa3b4d4138efc30dc0b21ab67ff97ce9d15cb7440d3d08f956671c36de0d66a28d047a2c3dd
@@ -427,6 +427,7 @@
427
427
  customblog/recentposts.html -%} {% endif %} {%- endif -%} {%- if
428
428
  featureData.author.size > 0 -%} {% include
429
429
  featurePageAuthors/featurePageAuthors.html %} {%- endif -%} {% include
430
- footer/index.html %} {% include script.html %}
430
+ footer/index.html %} {%- if site.customCode -%} {%- include customCode.html
431
+ -%} {%- endif -%} {% include script.html %}
431
432
  </body>
432
433
  </html>
data/_layouts/home.html CHANGED
@@ -270,8 +270,7 @@
270
270
  <div class="container compare-table">
271
271
  {%- include fileformat/comparisonfiles.html -%}
272
272
  </div>
273
- {%- endif -%} {%- if site.customCode -%} {%- include customCode.html -%} {%-
274
- endif -%} {%- assign langen = "en" -%} {%- if
273
+ {%- endif -%} {%- assign langen = "en" -%} {%- if
275
274
  site.data[folder][langen][file].categories -%} {% assign categories=
276
275
  site.data[folder][langen][file].categories %} {%- else -%} {% assign
277
276
  categories= page.categories %} {%- endif -%} {%- if
@@ -285,6 +284,7 @@
285
284
  customblog/recentposts.html -%} {% endif %} {%- endif -%} {%- if
286
285
  homeData.author.size > 0 -%} {% include
287
286
  featurePageAuthors/featurePageAuthors.html %} {%- endif -%} {% include
288
- footer/index.html %} {% include script.html %}
287
+ footer/index.html %} {%- if site.customCode -%} {%- include customCode.html
288
+ -%} {%- endif -%} {% include script.html %}
289
289
  </body>
290
290
  </html>
@@ -1,5 +1,47 @@
1
1
  ---
2
2
  ---
3
+ // Generate a unique ID for the user (if not already generated)
4
+ const generateUserID = () => {
5
+ // Check if the user ID is already stored in cookies or local storage
6
+ const storedUserID = getStoredUserID();
7
+
8
+ if (storedUserID) {
9
+ return storedUserID;
10
+ }
11
+
12
+ // Example: Generating a random string
13
+ const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
14
+ let id = '';
15
+ for (let i = 0; i < 10; i++) {
16
+ id += characters.charAt(Math.floor(Math.random() * characters.length));
17
+ }
18
+
19
+ // Store the generated user ID in cookies or local storage
20
+ storeUserID(id);
21
+
22
+ return id;
23
+ };
24
+
25
+ // Get the stored user ID from cookies or local storage
26
+ const getStoredUserID = () => {
27
+ return localStorage.getItem('userID');
28
+ };
29
+
30
+ // Store the user ID in cookies or local storage
31
+ const storeUserID = (userID) => {
32
+ localStorage.setItem('userID', userID);
33
+ };
34
+
35
+ // Get the current date in YYYY-MM-DD format
36
+ const getCurrentDate = () => {
37
+ const today = new Date();
38
+ const year = today.getFullYear();
39
+ const month = String(today.getMonth() + 1).padStart(2, '0');
40
+ const day = String(today.getDate()).padStart(2, '0');
41
+ return `${year}-${month}-${day}`;
42
+ };
43
+
44
+
3
45
 
4
46
  let userTrackingCountLimit='{{site.userTrackingCount}}';
5
47
  const checkUsage = () => {
@@ -17,8 +59,19 @@ const checkUsage = () => {
17
59
  // First usage of the day
18
60
  setCookie("featureUsageCount", 1, getExpirationDate());
19
61
  }
20
- };
21
-
62
+ const userID = generateUserID();
63
+ try {
64
+
65
+ gtag('event', 'feature_used', {
66
+ user_id: userID,
67
+ userID: userID,
68
+ feature: window.location.pathname + location.search
69
+ });
70
+ } catch (error) {
71
+ console.log(error)
72
+ }
73
+
74
+ }
22
75
  const incrementUsageCount = (count) => {
23
76
  const today = new Date().toDateString();
24
77
 
@@ -37,10 +90,19 @@ const showShareModal = () => {
37
90
  const handleShare = () => {
38
91
  const usageCount = getCookie("featureUsageCount");
39
92
  if (usageCount) {
40
- // Decrement the usage count by 1 if the user has already used the feature today
41
- setCookie("featureUsageCount", usageCount , getExpirationDate());
93
+ setCookie("featureUsageCount", 0 , getExpirationDate());
42
94
  }
43
95
  document.getElementById("shareModal").style.display = "none";
96
+ try {
97
+ const userID = generateUserID();
98
+ gtag('event', 'feature_shared', {
99
+ user_id: userID,
100
+ userID: userID,
101
+ feature: window.location.pathname + location.search
102
+ });
103
+ } catch (error) {
104
+ console.log(error)
105
+ }
44
106
  };
45
107
 
46
108
  const getCookie = (name) => {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appscms-tools-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.5
4
+ version: 3.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - vivek-appscms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-10 00:00:00.000000000 Z
11
+ date: 2023-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll