aesirx-analytics 2.2.21 → 2.3.1
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/dist/{Consent-OHFGKDZJ.js → Consent-5U2D4TQI.js} +4 -4
- package/dist/{ConsentCustom-UTTNESFI.js → ConsentCustom-JINUMJZ5.js} +24 -52
- package/dist/analytics.js +558 -723
- package/dist/{chunk-AS3MN6ER.js → chunk-FFLWRB5N.js} +312 -224
- package/dist/{chunk-NTEWP6UQ.js → chunk-NKOHXSTE.js} +238 -31
- package/dist/index.js +10 -12
- package/package.json +15 -9
- package/dist/chunk-YOHHSMUP.js +0 -182
@@ -1237,7 +1237,7 @@ var common_default7 = {
|
|
1237
1237
|
txt_connecting: "\u0110ang k\u1EBFt n\u1ED1i",
|
1238
1238
|
txt_here: "\u0110\xC2Y",
|
1239
1239
|
txt_visit: "\u0110\u1EBFn",
|
1240
|
-
txt_tracking_data_privacy: "THEO D\xD5I QUY\u1EC0N RI\xCANG T\u01AF D\u1EEE LI\u1EC6U
|
1240
|
+
txt_tracking_data_privacy: "TU\u1EF2 CH\u1ECCN THEO D\xD5I V\xC0 QUY\u1EC0N RI\xCANG T\u01AF D\u1EEE LI\u1EC6U",
|
1241
1241
|
txt_consent: "\u0110\u1ED3ng \xFD",
|
1242
1242
|
txt_about: "Gi\u1EDBi thi\u1EC7u",
|
1243
1243
|
txt_detail: "Chi ti\u1EBFt",
|
@@ -1255,51 +1255,51 @@ var common_default7 = {
|
|
1255
1255
|
txt_your_current_level: "M\u1EE9c \u0111\u1ED9 \u0111\u1ED3ng \xFD hi\u1EC7n t\u1EA1i c\u1EE7a b\u1EA1n l\xE0:",
|
1256
1256
|
txt_upgrade_consent_to: "\u0110\u1ED3ng \xFD n\xE2ng c\u1EA5p l\xEAn:",
|
1257
1257
|
txt_upgrade_consent: "\u0110\u1ED3ng \xFD n\xE2ng c\u1EA5p",
|
1258
|
-
txt_change_consent: "
|
1258
|
+
txt_change_consent: "\u0110\u1ED3ng \xDD Phi T\u1EADp Trung",
|
1259
1259
|
txt_upgrade_consent_text: "N\xE2ng c\u1EA5p m\u1EE9c \u0111\u1ED9 \u0111\u1ED3ng \xFD c\u1EE7a b\u1EA1n v\xE0 t\u1EADn h\u01B0\u1EDFng to\xE0n b\u1ED9 l\u1EE3i \xEDch c\u1EE7a L\xE1 ch\u1EAFn b\u1EA3o m\u1EADt \u0111\u1EC3 c\xF3 \u0111\u01B0\u1EE3c tr\u1EA3i nghi\u1EC7m k\u1EF9 thu\u1EADt s\u1ED1 \u0111\u01B0\u1EE3c x\xE1c th\u1EF1c b\u1EB1ng ID, t\xF9y ch\u1EC9nh, an to\xE0n.",
|
1260
1260
|
txt_cancel: "H\u1EE7y",
|
1261
1261
|
txt_no_personal_data: "Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u c\xE1 nh\xE2n n\xE0o \u0111\u01B0\u1EE3c chia s\u1EBB ho\u1EB7c b\xE1n cho b\xEAn th\u1EE9 3.",
|
1262
|
-
txt_manage_your_consent: "Qu\u1EA3n l\xFD
|
1263
|
-
txt_choose_how_we_use: "Ch\u1ECDn c\xE1ch ch\xFAng t\xF4i s\u1EED d\u1EE5ng d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n: \u201CT\u1EEB ch\u1ED1i\u201D thu th\u1EADp d\u1EEF li\u1EC7u, cho ph\xE9p theo d\xF5i [\
|
1264
|
-
txt_choose_how_we_use_simple: "Ch\u1ECDn c\xE1ch ch\xFAng t\xF4i s\u1EED d\u1EE5ng d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n: \u201CT\u1EEB ch\u1ED1i\u201D
|
1265
|
-
txt_by_consenting: "
|
1266
|
-
txt_analytics_behavioral: "
|
1267
|
-
txt_form_data: "D\u1EEF
|
1262
|
+
txt_manage_your_consent: "Qu\u1EA3n l\xFD T\xF9y Ch\u1ECDn \u0110\u1ED3ng \xDD c\u1EE7a b\u1EA1n",
|
1263
|
+
txt_choose_how_we_use: "Ch\u1ECDn c\xE1ch ch\xFAng t\xF4i s\u1EED d\u1EE5ng d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n: \u201CT\u1EEB ch\u1ED1i\u201D thu th\u1EADp d\u1EEF li\u1EC7u, cho ph\xE9p theo d\xF5i [\u201C\u0110\u1ED3ng \xFD\u201D], ho\u1EB7c s\u1EED d\u1EE5ng \u201C\u0110\u1ED3ng \xDD Phi T\u1EADp Trung\u201D \u0111\u1EC3 c\xF3 nhi\u1EC1u quy\u1EC1n ki\u1EC3m so\xE1t h\u01A1n \u0111\u1ED1i v\u1EDBi d\u1EEF li\u1EC7u c\xE1 nh\xE2n c\u1EE7a b\u1EA1n v\xE0 nh\u1EADn ph\u1EA7n th\u01B0\u1EDFng.",
|
1264
|
+
txt_choose_how_we_use_simple: "Ch\u1ECDn c\xE1ch ch\xFAng t\xF4i s\u1EED d\u1EE5ng d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n: \u201CT\u1EEB ch\u1ED1i\u201D thu th\u1EADp d\u1EEF li\u1EC7u, cho ph\xE9p theo d\xF5i [\u201C\u0110\u1ED3ng \xFD\u201D].",
|
1265
|
+
txt_by_consenting: "Khi \u0111\u1ED3ng \xFD, b\u1EA1n cho ph\xE9p ch\xFAng t\xF4i thu th\u1EADp v\xE0 s\u1EED d\u1EE5ng d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n cho:",
|
1266
|
+
txt_analytics_behavioral: "Ph\xE2n T\xEDch & D\u1EEF Li\u1EC7u H\xE0nh Vi: \u0110\u1EC3 c\u1EA3i thi\u1EC7n d\u1ECBch v\u1EE5 c\u1EE7a ch\xFAng t\xF4i v\xE0 c\xE1 nh\xE2n h\xF3a tr\u1EA3i nghi\u1EC7m c\u1EE7a b\u1EA1n.",
|
1267
|
+
txt_form_data: "D\u1EEF Li\u1EC7u Bi\u1EC3u M\u1EABu: Khi b\u1EA1n li\xEAn h\u1EC7 v\u1EDBi ch\xFAng t\xF4i.",
|
1268
1268
|
txt_please_note: "Xin l\u01B0u \xFD",
|
1269
1269
|
txt_we_do_not_share: "Ch\xFAng t\xF4i kh\xF4ng chia s\u1EBB d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n v\u1EDBi b\xEAn th\u1EE9 ba m\xE0 kh\xF4ng c\xF3 s\u1EF1 \u0111\u1ED3ng \xFD r\xF5 r\xE0ng c\u1EE7a b\u1EA1n.",
|
1270
|
-
txt_you_can_opt_in: "B\u1EA1n c\xF3 th\u1EC3
|
1270
|
+
txt_you_can_opt_in: "B\u1EA1n c\xF3 th\u1EC3 \u0111\u1ED3ng \xFD cho c\xE1c t\xEDnh n\u0103ng c\u1EE5 th\u1EC3 sau m\xE0 kh\xF4ng c\u1EA7n \u0111\u1ED3ng \xFD chung.",
|
1271
1271
|
txt_for_more_details: "\u0110\u1EC3 bi\u1EBFt th\xEAm chi ti\u1EBFt, h\xE3y tham kh\u1EA3o <a class='text-success fw-semibold text-decoration-underline' href='https://aesirx.io/privacy-policy' target='_blank'>ch\xEDnh s\xE1ch quy\u1EC1n ri\xEAng t\u01B0</a> c\u1EE7a ch\xFAng t\xF4i.",
|
1272
1272
|
txt_benefit: "L\u1EE3i \xEDch",
|
1273
|
-
txt_control_your_data: "<span class='fw-semibold text-primary'>Ki\u1EC3m so\xE1t d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n:</span> Ch\u1ECDn m\u1EE9c \u0111\u1ED9 thu th\u1EADp v\xE0 theo d\xF5i d\u1EEF li\u1EC7u \
|
1274
|
-
txt_earn_rewards: "<span class='fw-semibold text-primary'>
|
1275
|
-
txt_transparent_data: "<span class='fw-semibold text-primary'>
|
1276
|
-
|
1277
|
-
txt_reject_no_data: "<span class='fw-semibold text-primary'>T\u1EEB ch\u1ED1i:</span>
|
1273
|
+
txt_control_your_data: "<span class='fw-semibold text-primary'>Ki\u1EC3m so\xE1t d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n:</span> Ch\u1ECDn m\u1EE9c \u0111\u1ED9 thu th\u1EADp v\xE0 theo d\xF5i d\u1EEF li\u1EC7u m\xE0 b\u1EA1n mu\u1ED1n.",
|
1274
|
+
txt_earn_rewards: "<span class='fw-semibold text-primary'>Nh\u1EADn ph\u1EA7n th\u01B0\u1EDFng:</span> Tham gia v\xE0o \u0111\u1ED3ng \xFD phi t\u1EADp trung \u0111\u1EC3 b\u1EA3o m\u1EADt v\xE0 nh\u1EADn ph\u1EA7n th\u01B0\u1EDFng.",
|
1275
|
+
txt_transparent_data: "<span class='fw-semibold text-primary'>Th\u1EF1c h\xE0nh thu th\u1EADp d\u1EEF li\u1EC7u minh b\u1EA1ch:</span> Hi\u1EC3u c\xE1ch d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n \u0111\u01B0\u1EE3c thu th\u1EADp v\xE0 s\u1EED d\u1EE5ng.",
|
1276
|
+
txt_understanding_your_privacy: "Hi\u1EC3u l\u1EF1a ch\u1ECDn quy\u1EC1n ri\xEAng t\u01B0 c\u1EE7a b\u1EA1n",
|
1277
|
+
txt_reject_no_data: "<span class='fw-semibold text-primary'>T\u1EEB ch\u1ED1i:</span> Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u n\xE0o \u0111\u01B0\u1EE3c thu th\u1EADp ho\u1EB7c t\u1EA3i, ngo\u1EA1i tr\u1EEB c\xE1c l\u01B0\u1EE3t xem trang \u1EA9n danh v\xE0 c\xE1c t\u1EEB ch\u1ED1i. M\u1ED9t s\u1ED1 t\xEDnh n\u0103ng c\xE1 nh\xE2n h\xF3a c\xF3 th\u1EC3 b\u1ECB v\xF4 hi\u1EC7u h\xF3a.",
|
1278
1278
|
txt_consent_first_third_party: "<span class='fw-semibold text-primary'>\u0110\u1ED3ng \xFD:</span> D\u1EEF li\u1EC7u theo d\xF5i c\u1EE7a b\xEAn th\u1EE9 nh\u1EA5t v\xE0 b\xEAn th\u1EE9 ba s\u1EBD \u0111\u01B0\u1EE3c thu th\u1EADp \u0111\u1EC3 n\xE2ng cao tr\u1EA3i nghi\u1EC7m c\u1EE7a b\u1EA1n.",
|
1279
|
-
txt_decentralizered_consent_choose: "<span class='fw-semibold text-primary'
|
1279
|
+
txt_decentralizered_consent_choose: "<span class='fw-semibold text-primary'>\u0110\u1ED3ng \xFD Phi t\u1EADp trung:</span> Ch\u1ECDn V\xED Phi t\u1EADp trung, ho\u1EB7c V\xED Phi t\u1EADp trung + L\xE1 ch\u1EAFn b\u1EA3o m\u1EADt. C\u1EA3 hai t\xF9y ch\u1ECDn \u0111\u1EC1u cho ph\xE9p b\u1EA1n qu\u1EA3n l\xFD v\xE0 thu h\u1ED3i \u0111\u1ED3ng \xFD tr\xEAn trang ho\u1EB7c th\xF4ng qua \u1EE9ng d\u1EE5ng AesirX dApp, \u0111\u1ED3ng th\u1EDDi nh\u1EADn ph\u1EA7n th\u01B0\u1EDFng t\u1EEB c\xE1c ho\u1EA1t \u0111\u1ED9ng ti\u1EBFp th\u1ECB k\u1EF9 thu\u1EADt s\u1ED1.",
|
1280
1280
|
txt_our_commitment_in_action: "Cam k\u1EBFt h\xE0nh \u0111\u1ED9ng c\u1EE7a ch\xFAng t\xF4i",
|
1281
1281
|
txt_private_protection: "<span class='fw-semibold text-primary'>B\u1EA3o v\u1EC7 quy\u1EC1n ri\xEAng t\u01B0:</span> Ng\u01B0\u1EDDi d\xF9ng c\xF3 to\xE0n quy\u1EC1n ki\u1EC3m so\xE1t d\u1EEF li\u1EC7u c\u1EE7a m\xECnh, \u0111\u1EA3m b\u1EA3o quy\u1EC1n ri\xEAng t\u01B0 t\u1ED1i \u0111a.",
|
1282
|
-
txt_enables_compliance: "<span class='fw-semibold text-primary'
|
1282
|
+
txt_enables_compliance: "<span class='fw-semibold text-primary'>\u0110\u1EA3m b\u1EA3o tu\xE2n th\u1EE7:</span> S\u1EED d\u1EE5ng L\xE1 ch\u1EAFn b\u1EA3o m\u1EADt (SoP) \u0111\u1EA3m b\u1EA3o tu\xE2n th\u1EE7 GDPR, CCPA, ch\u1EC9 th\u1ECB ePrivacy v\xE0 c\xE1c quy \u0111\u1ECBnh b\u1EA3o v\u1EC7 d\u1EEF li\u1EC7u kh\xE1c.",
|
1283
1283
|
txt_proactive_protection: "<span class='fw-semibold text-primary'>B\u1EA3o v\u1EC7 ch\u1EE7 \u0111\u1ED9ng:</span> Ch\xFAng t\xF4i t\u0103ng c\u01B0\u1EDDng c\xE1c bi\u1EC7n ph\xE1p b\u1EA3o v\u1EC7 quy\u1EC1n ri\xEAng t\u01B0 \u0111\u1EC3 b\u1EA3o v\u1EC7 t\xEDnh to\xE0n v\u1EB9n d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n.",
|
1284
|
-
txt_flexible_consent: "<span class='fw-semibold text-primary'>S\u1EF1 \u0111\u1ED3ng \xFD linh ho\u1EA1t:</span> B\u1EA1n c\xF3 th\u1EC3 r\xFAt l\u1EA1i s\u1EF1 \u0111\u1ED3ng \xFD c\u1EE7a m\xECnh b\u1EA5t c\u1EE9 l\xFAc n\xE0o
|
1284
|
+
txt_flexible_consent: "<span class='fw-semibold text-primary'>S\u1EF1 \u0111\u1ED3ng \xFD linh ho\u1EA1t:</span> B\u1EA1n c\xF3 th\u1EC3 r\xFAt l\u1EA1i s\u1EF1 \u0111\u1ED3ng \xFD c\u1EE7a m\xECnh b\u1EA5t c\u1EE9 l\xFAc n\xE0o tr\xEAn trang web ho\u1EB7c qua \u1EE9ng d\u1EE5ng phi t\u1EADp trung <a class='text-success fw-semibold text-decoration-underline' href='https://dapp.shield.aesirx.io' target='_blank'>dApp</a> c\u1EE7a ch\xFAng t\xF4i",
|
1285
1285
|
txt_learn_more: "<span class='fw-semibold text-primary'>T\xECm hi\u1EC3u th\xEAm:</span> Kh\xE1m ph\xE1 ph\u01B0\u01A1ng ph\xE1p x\u1EED l\xFD d\u1EEF li\u1EC7u c\u1EE7a ch\xFAng t\xF4i trong <a class='text-success fw-semibold text-trang tr\xED-underline' c\u1EE7a ch\xFAng t\xF4i href='https://aesirx.io/privacy-policy' target='_blank'>Ch\xEDnh s\xE1ch quy\u1EC1n ri\xEAng t\u01B0</a>.",
|
1286
1286
|
txt_for_business: "<span class='fw-semibold text-primary'>D\xE0nh cho doanh nghi\u1EC7p:</span> N\xE2ng cao ni\u1EC1m tin, b\u1EA3o m\u1EADt danh t\xEDnh ng\u01B0\u1EDDi d\xF9ng v\xE0 ng\u0103n ch\u1EB7n vi ph\u1EA1m.",
|
1287
1287
|
txt_more_info_at: "Th\xF4ng tin th\xEAm t\u1EA1i <a class='text-success fw-semibold text-trang tr\xED-underline' href='https://shield.aesirx.io' target='_blank'>https://shield. aesirx.io</a>.",
|
1288
|
-
txt_select_your_preferred: "Ch\u1ECDn t\xF9y ch\u1ECDn \u0111\u1ED3ng \xFD phi t\u1EADp trung \
|
1289
|
-
txt_decentralized_wallet: "
|
1290
|
-
txt_decentralized_wallet_will_be_loaded: "
|
1291
|
-
txt_both_first_party_third_party: "
|
1292
|
-
txt_all_consented_data_will_be_collected: "T\u1EA5t c\u1EA3 d\u1EEF li\u1EC7u \u0111\u01B0\u1EE3c \u0111\u1ED3ng \xFD s\u1EBD \u0111\u01B0\u1EE3c thu th\u1EADp.",
|
1293
|
-
txt_users_can_revoke: "Ng\u01B0\u1EDDi d\xF9ng c\xF3 th\u1EC3 thu h\u1ED3i
|
1294
|
-
txt_decentralized_wallet_shield: "
|
1295
|
-
txt_users_can_revoke_dapp: "Ng\u01B0\u1EDDi d\xF9ng c\xF3 th\u1EC3 thu h\u1ED3i
|
1296
|
-
txt_users_can_earn: "Ng\u01B0\u1EDDi d\xF9ng c\xF3 th\u1EC3
|
1288
|
+
txt_select_your_preferred: "Ch\u1ECDn t\xF9y ch\u1ECDn \u0111\u1ED3ng \xFD phi t\u1EADp trung m\xE0 b\u1EA1n mu\u1ED1n:",
|
1289
|
+
txt_decentralized_wallet: "\u0110\u1ED3ng \xDD Phi T\u1EADp Trung",
|
1290
|
+
txt_decentralized_wallet_will_be_loaded: "\u0110\u1ED3ng \xFD phi t\u1EADp trung s\u1EBD \u0111\u01B0\u1EE3c k\xEDch ho\u1EA1t.",
|
1291
|
+
txt_both_first_party_third_party: "D\u1EEF li\u1EC7u theo d\xF5i t\u1EEB c\u1EA3 b\xEAn th\u1EE9 nh\u1EA5t v\xE0 b\xEAn th\u1EE9 ba s\u1EBD \u0111\u01B0\u1EE3c thu th\u1EADp.",
|
1292
|
+
txt_all_consented_data_will_be_collected: "T\u1EA5t c\u1EA3 d\u1EEF li\u1EC7u \u0111\xE3 \u0111\u01B0\u1EE3c \u0111\u1ED3ng \xFD s\u1EBD \u0111\u01B0\u1EE3c thu th\u1EADp.",
|
1293
|
+
txt_users_can_revoke: "Ng\u01B0\u1EDDi d\xF9ng c\xF3 th\u1EC3 thu h\u1ED3i \u0111\u1ED3ng \xFD tr\xEAn trang web b\u1EA5t k\u1EF3 l\xFAc n\xE0o.",
|
1294
|
+
txt_decentralized_wallet_shield: "\u0110\u1ED3ng \xDD Phi T\u1EADp Trung + Shield of Privacy",
|
1295
|
+
txt_users_can_revoke_dapp: "Ng\u01B0\u1EDDi d\xF9ng c\xF3 th\u1EC3 thu h\u1ED3i \u0111\u1ED3ng \xFD tr\xEAn trang web ho\u1EB7c qua \u1EE9ng d\u1EE5ng AesirX dApp b\u1EA5t k\u1EF3 l\xFAc n\xE0o.",
|
1296
|
+
txt_users_can_earn: "Ng\u01B0\u1EDDi d\xF9ng c\xF3 th\u1EC3 nh\u1EADn ph\u1EA7n th\u01B0\u1EDFng t\u1EEB c\xE1c ho\u1EA1t \u0111\u1ED9ng ti\u1EBFp th\u1ECB k\u1EF9 thu\u1EADt s\u1ED1.",
|
1297
1297
|
txt_continue: "Ti\u1EBFp t\u1EE5c",
|
1298
1298
|
txt_back: "Quay l\u1EA1i",
|
1299
1299
|
txt_you_have_chosen: "B\u1EA1n \u0111\xE3 ch\u1ECDn t\u1EEB ch\u1ED1i thu th\u1EADp d\u1EEF li\u1EC7u:",
|
1300
|
-
txt_only_anonymized: "
|
1301
|
-
txt_consent_allow_data: "<span class='fw-semibold text-primary'>\u0110\u1ED3ng \xFD:</span> Cho ph\xE9p thu th\u1EADp d\u1EEF li\u1EC7u \u0111\u1EC3 ph\xE2n t\xEDch, d\u1EEF li\u1EC7u bi\u1EC3u m\u1EABu (khi b\u1EA1n li\xEAn h\u1EC7 v\u1EDBi ch\xFAng t\xF4i)
|
1302
|
-
txt_decentralized_consent_allow_data: "<span class='fw-semibold text-primary'
|
1300
|
+
txt_only_anonymized: "B\u1EA1n ch\u1EC9 c\xF3 th\u1EC3 xem trang \u1EA9n danh v\xE0 s\u1EED d\u1EE5ng c\xE1c t\xEDnh n\u0103ng h\u1EA1n ch\u1EBF. \u0110\u1EC3 truy c\u1EADp t\u1EA5t c\u1EA3 c\xE1c t\xEDnh n\u0103ng c\u1EE7a trang web, bao g\u1ED3m n\u1ED9i dung c\xE1 nh\xE2n h\xF3a v\xE0 ch\u1EE9c n\u0103ng n\xE2ng cao, vui l\xF2ng ch\u1ECDn m\u1ED9t trong c\xE1c t\xF9y ch\u1ECDn sau:",
|
1301
|
+
txt_consent_allow_data: "<span class='fw-semibold text-primary'>\u0110\u1ED3ng \xFD:</span> Cho ph\xE9p thu th\u1EADp d\u1EEF li\u1EC7u \u0111\u1EC3 ph\xE2n t\xEDch, d\u1EEF li\u1EC7u t\u1EEB bi\u1EC3u m\u1EABu (khi b\u1EA1n li\xEAn h\u1EC7 v\u1EDBi ch\xFAng t\xF4i) v\xE0 theo d\xF5i h\xE0nh vi v\xE0 s\u1EF1 ki\u1EC7n. B\u1EA1n c\u0169ng c\xF3 th\u1EC3 ch\u1ECDn tham gia v\xE0o c\xE1c t\xEDnh n\u0103ng c\u1EE5 th\u1EC3.",
|
1302
|
+
txt_decentralized_consent_allow_data: "<span class='fw-semibold text-primary'>\u0110\u1ED3ng \xFD phi t\u1EADp trung:</span> Cho ph\xE9p thu th\u1EADp d\u1EEF li\u1EC7u \u0111\u1EC3 ph\xE2n t\xEDch, d\u1EEF li\u1EC7u t\u1EEB bi\u1EC3u m\u1EABu (khi b\u1EA1n li\xEAn h\u1EC7 v\u1EDBi ch\xFAng t\xF4i) v\xE0 theo d\xF5i h\xE0nh vi v\xE0 s\u1EF1 ki\u1EC7n. B\u1EA1n c\xF3 th\u1EC3 thu h\u1ED3i s\u1EF1 \u0111\u1ED3ng \xFD b\u1EA5t c\u1EE9 l\xFAc n\xE0o, ch\u1ECDn tham gia v\xE0o c\xE1c t\xEDnh n\u0103ng c\u1EE5 th\u1EC3 v\xE0 nh\u1EADn ph\u1EA7n th\u01B0\u1EDFng t\u1EEB c\xE1c ho\u1EA1t \u0111\u1ED9ng ti\u1EBFp th\u1ECB k\u1EF9 thu\u1EADt s\u1ED1.",
|
1303
1303
|
txt_you_can_revoke_on_the_site: "B\u1EA1n c\xF3 th\u1EC3 thu h\u1ED3i s\u1EF1 \u0111\u1ED3ng \xFD tr\xEAn trang web ho\u1EB7c b\u1EA5t k\u1EF3 s\u1EF1 \u0111\u1ED3ng \xFD ch\u1ECDn tham gia r\xF5 r\xE0ng n\xE0o, ch\u1EB3ng h\u1EA1n nh\u01B0 x\u1EED l\xFD thanh to\xE1n, b\u1EA5t k\u1EF3 l\xFAc n\xE0o",
|
1304
1304
|
txt_revoke_opt_in: "Thu h\u1ED3i s\u1EF1 \u0111\u1ED3ng \xFD tham gia",
|
1305
1305
|
txt_revoke_opt_in_payment: "Thu h\u1ED3i s\u1EF1 \u0111\u1ED3ng \xFD ch\u1ECDn tham gia \u0111\u1EC3 x\u1EED l\xFD thanh to\xE1n",
|
@@ -1657,6 +1657,7 @@ var AesirXI18nextProvider = ({
|
|
1657
1657
|
});
|
1658
1658
|
return /* @__PURE__ */ React2.createElement(I18NextContext.Provider, { value: { listLanguages } }, /* @__PURE__ */ React2.createElement(I18nextProvider, { i18n }, children));
|
1659
1659
|
};
|
1660
|
+
var useI18nextContext = () => useContext4(I18NextContext);
|
1660
1661
|
|
1661
1662
|
// src/utils/AnalyticsContextProvider.tsx
|
1662
1663
|
var AnalyticsContext = React3.createContext({
|
@@ -1975,10 +1976,210 @@ var getFingerprint = () => {
|
|
1975
1976
|
};
|
1976
1977
|
var fingerprint_default = getFingerprint;
|
1977
1978
|
|
1979
|
+
// src/utils/services.ts
|
1980
|
+
var cache;
|
1981
|
+
var assign = (a, b) => {
|
1982
|
+
Object.keys(b).forEach((key) => {
|
1983
|
+
if (b[key] !== void 0)
|
1984
|
+
a[key] = b[key];
|
1985
|
+
});
|
1986
|
+
return a;
|
1987
|
+
};
|
1988
|
+
var trackerService = async (endpoint, payload) => {
|
1989
|
+
const fetchData = await fetch(endpoint, {
|
1990
|
+
method: "POST",
|
1991
|
+
body: JSON.stringify(payload),
|
1992
|
+
headers: assign({ "Content-Type": "application/json" }, { ["x-tracker-cache"]: cache })
|
1993
|
+
});
|
1994
|
+
const response = await fetchData.json();
|
1995
|
+
if (response.error) {
|
1996
|
+
throw response.error;
|
1997
|
+
} else {
|
1998
|
+
return response;
|
1999
|
+
}
|
2000
|
+
};
|
2001
|
+
|
2002
|
+
// src/utils/index.ts
|
2003
|
+
import Bowser from "bowser";
|
2004
|
+
var createRequest = (endpoint, task) => {
|
2005
|
+
return `${endpoint}/visitor/v1/${task}`;
|
2006
|
+
};
|
2007
|
+
var createRequestV2 = (endpoint, task) => {
|
2008
|
+
return `${endpoint}/visitor/v2/${task}`;
|
2009
|
+
};
|
2010
|
+
var rememberFlow = (endpoint, flow) => {
|
2011
|
+
return `${endpoint}/remember_flow/${flow}`;
|
2012
|
+
};
|
2013
|
+
var startTracker = async (endpoint, url, referer, user_agent, attributesVisit) => {
|
2014
|
+
const allow = sessionStorage.getItem("aesirx-analytics-allow");
|
2015
|
+
const reject = sessionStorage.getItem("aesirx-analytics-rejected");
|
2016
|
+
if (allow === "0" || reject === "true") {
|
2017
|
+
return null;
|
2018
|
+
}
|
2019
|
+
const { location, document: document2 } = window;
|
2020
|
+
const { pathname, search, origin } = location;
|
2021
|
+
url = `${origin}${pathname}${search}`;
|
2022
|
+
referer = referer ? location.protocol + "//" + location.host + referer : document2.referrer ? document2.referrer : window["referer"] ? window["referer"] === "/" ? location.protocol + "//" + location.host : location.protocol + "//" + location.host + window["referer"] : "";
|
2023
|
+
user_agent = window.navigator.userAgent;
|
2024
|
+
const browser = Bowser.parse(window.navigator.userAgent);
|
2025
|
+
const browser_name = browser?.browser?.name;
|
2026
|
+
const browser_version = browser?.browser?.version ?? "0";
|
2027
|
+
const lang = window.navigator["userLanguage"] || window.navigator.language;
|
2028
|
+
const device = browser?.platform?.model ?? browser?.platform?.type;
|
2029
|
+
const queryString = window.location.search;
|
2030
|
+
const urlParams = new URLSearchParams(queryString);
|
2031
|
+
const ip = "";
|
2032
|
+
try {
|
2033
|
+
const fingerprint = fingerprint_default();
|
2034
|
+
const attributes = [];
|
2035
|
+
for (const key of urlParams.keys()) {
|
2036
|
+
if (key.startsWith("utm_")) {
|
2037
|
+
urlParams.get(key) && attributes.push({ name: key, value: urlParams.get(key) });
|
2038
|
+
}
|
2039
|
+
}
|
2040
|
+
if (attributesVisit?.length) {
|
2041
|
+
attributesVisit?.forEach((element) => {
|
2042
|
+
element?.name && attributes.push({ name: element?.name, value: element?.value });
|
2043
|
+
});
|
2044
|
+
}
|
2045
|
+
const responseStart = await trackerService(createRequestV2(endpoint, "start"), {
|
2046
|
+
fingerprint,
|
2047
|
+
url: url?.replace(/^(https?:\/\/)?(www\.)?/, "$1"),
|
2048
|
+
...referer && (referer !== url || document2.referrer) && {
|
2049
|
+
referer: referer !== url ? referer?.replace(/^(https?:\/\/)?(www\.)?/, "$1") : document2.referrer?.replace(/^(https?:\/\/)?(www\.)?/, "$1")
|
2050
|
+
},
|
2051
|
+
user_agent,
|
2052
|
+
ip,
|
2053
|
+
browser_name,
|
2054
|
+
browser_version,
|
2055
|
+
lang,
|
2056
|
+
device: device?.includes("iPhone") ? "mobile" : device?.includes("iPad") ? "tablet" : device,
|
2057
|
+
...attributes?.length && {
|
2058
|
+
event_name: "visit",
|
2059
|
+
event_type: "action",
|
2060
|
+
attributes
|
2061
|
+
}
|
2062
|
+
});
|
2063
|
+
if (window["aesirxTrackEcommerce"] === "true" && sessionStorage.getItem("aesirx-analytics-flow") !== (await responseStart)?.flow_uuid) {
|
2064
|
+
sessionStorage.setItem("aesirx-analytics-flow", (await responseStart)?.flow_uuid);
|
2065
|
+
try {
|
2066
|
+
await trackerService(
|
2067
|
+
rememberFlow(window.location.origin, (await responseStart)?.flow_uuid),
|
2068
|
+
{}
|
2069
|
+
);
|
2070
|
+
} catch (error) {
|
2071
|
+
console.log("Remember Flow Error", error);
|
2072
|
+
}
|
2073
|
+
}
|
2074
|
+
return responseStart;
|
2075
|
+
} catch (error) {
|
2076
|
+
console.error("Analytics Error: ", error);
|
2077
|
+
}
|
2078
|
+
};
|
2079
|
+
var trackEvent = async (endpoint, referer, data) => {
|
2080
|
+
const allow = sessionStorage.getItem("aesirx-analytics-allow");
|
2081
|
+
const reject = sessionStorage.getItem("aesirx-analytics-rejected");
|
2082
|
+
if (allow === "0" || reject === "true") {
|
2083
|
+
return null;
|
2084
|
+
}
|
2085
|
+
const { location, document: document2 } = window;
|
2086
|
+
referer = referer ? location.protocol + "//" + location.host + referer : document2.referrer ? document2.referrer : window["referer"] ? window["referer"] === "/" ? location.protocol + "//" + location.host : location.protocol + "//" + location.host + window["referer"] : "";
|
2087
|
+
const url = location.protocol + "//" + location.host + location.pathname;
|
2088
|
+
const user_agent = window.navigator.userAgent;
|
2089
|
+
const browser = Bowser.parse(window.navigator.userAgent);
|
2090
|
+
const browser_name = browser?.browser?.name;
|
2091
|
+
const browser_version = browser?.browser?.version ?? "0";
|
2092
|
+
const lang = window.navigator["userLanguage"] || window.navigator.language;
|
2093
|
+
const device = browser?.platform?.model ?? browser?.platform?.type;
|
2094
|
+
const ip = "";
|
2095
|
+
const fingerprint = fingerprint_default();
|
2096
|
+
const headers = { type: "application/json" };
|
2097
|
+
const blobData = new Blob(
|
2098
|
+
[
|
2099
|
+
JSON.stringify({
|
2100
|
+
fingerprint,
|
2101
|
+
url: url?.replace(/^(https?:\/\/)?(www\.)?/, "$1"),
|
2102
|
+
...referer !== "/" && referer && {
|
2103
|
+
referer: referer?.replace(/^(https?:\/\/)?(www\.)?/, "$1")
|
2104
|
+
},
|
2105
|
+
user_agent,
|
2106
|
+
ip,
|
2107
|
+
browser_name,
|
2108
|
+
browser_version,
|
2109
|
+
lang,
|
2110
|
+
device: device?.includes("iPhone") ? "mobile" : device?.includes("iPad") ? "tablet" : device,
|
2111
|
+
...data
|
2112
|
+
})
|
2113
|
+
],
|
2114
|
+
headers
|
2115
|
+
);
|
2116
|
+
const responseStart = navigator.sendBeacon(createRequestV2(endpoint, "start"), blobData);
|
2117
|
+
return responseStart;
|
2118
|
+
};
|
2119
|
+
var endTracker = (endPoint, event_uuid, visitor_uuid) => {
|
2120
|
+
if (event_uuid && visitor_uuid) {
|
2121
|
+
const body = {
|
2122
|
+
event_uuid,
|
2123
|
+
visitor_uuid
|
2124
|
+
};
|
2125
|
+
const headers = { type: "application/json" };
|
2126
|
+
const blob = new Blob([JSON.stringify(body)], headers);
|
2127
|
+
navigator.sendBeacon(createRequest(endPoint, "end"), blob);
|
2128
|
+
}
|
2129
|
+
};
|
2130
|
+
var endTrackerVisibilityState = (endPoint) => {
|
2131
|
+
document.addEventListener("visibilitychange", async () => {
|
2132
|
+
if (document.visibilityState === "hidden") {
|
2133
|
+
endTracker(endPoint, window["event_uuid"], window["visitor_uuid"]);
|
2134
|
+
}
|
2135
|
+
if (document.visibilityState === "visible") {
|
2136
|
+
const response = await startTracker(endPoint, "", "", "", window["attributes"]);
|
2137
|
+
window["event_uuid"] = response?.event_uuid;
|
2138
|
+
}
|
2139
|
+
});
|
2140
|
+
window.addEventListener(
|
2141
|
+
"pagehide",
|
2142
|
+
(event) => {
|
2143
|
+
if (event.persisted) {
|
2144
|
+
endTracker(endPoint, window["event_uuid"], window["visitor_uuid"]);
|
2145
|
+
}
|
2146
|
+
},
|
2147
|
+
false
|
2148
|
+
);
|
2149
|
+
};
|
2150
|
+
var unBlockScripts = () => {
|
2151
|
+
window["configBlockJS"]._backupNodes = window["configBlockJS"]?._backupNodes.filter(
|
2152
|
+
({ position, node, uniqueID }) => {
|
2153
|
+
try {
|
2154
|
+
if (node.nodeName.toLowerCase() === "script") {
|
2155
|
+
const scriptNode = document.createElement("script");
|
2156
|
+
scriptNode.src = node.src;
|
2157
|
+
scriptNode.type = "text/javascript";
|
2158
|
+
document[position].appendChild(scriptNode);
|
2159
|
+
} else {
|
2160
|
+
const frame = document.getElementById(uniqueID);
|
2161
|
+
if (!frame)
|
2162
|
+
return false;
|
2163
|
+
const iframe = document.createElement("iframe");
|
2164
|
+
iframe.src = node.src;
|
2165
|
+
iframe.width = frame.offsetWidth;
|
2166
|
+
iframe.height = frame.offsetHeight;
|
2167
|
+
frame.parentNode.insertBefore(iframe, frame);
|
2168
|
+
frame.parentNode.removeChild(frame);
|
2169
|
+
}
|
2170
|
+
return false;
|
2171
|
+
} catch (error) {
|
2172
|
+
console.error(error);
|
2173
|
+
return false;
|
2174
|
+
}
|
2175
|
+
}
|
2176
|
+
);
|
2177
|
+
};
|
2178
|
+
|
1978
2179
|
// src/utils/consent.ts
|
1979
2180
|
import { stringMessage } from "@concordium/react-components";
|
1980
2181
|
import axios from "axios";
|
1981
|
-
import
|
2182
|
+
import Bowser2 from "bowser";
|
1982
2183
|
var agreeConsents = async (endpoint, level, uuid, consent, wallet, signature, web3id, jwt, network = "concordium", gtagId, gtmId) => {
|
1983
2184
|
const url = `${endpoint}/consent/v1/level${level}/${uuid}`;
|
1984
2185
|
const urlV2 = `${endpoint}/consent/v2/level${level}/${uuid}`;
|
@@ -1992,7 +2193,7 @@ var agreeConsents = async (endpoint, level, uuid, consent, wallet, signature, we
|
|
1992
2193
|
const currentUrl = `${origin}${pathname}${search}`;
|
1993
2194
|
const referer = document2.referrer ? document2.referrer : window["referer"] ? window["referer"] === "/" ? location.protocol + "//" + location.host : location.protocol + "//" + location.host + window["referer"] : "";
|
1994
2195
|
const user_agent = window.navigator.userAgent;
|
1995
|
-
const browser =
|
2196
|
+
const browser = Bowser2.parse(window.navigator.userAgent);
|
1996
2197
|
const browser_name = browser?.browser?.name;
|
1997
2198
|
const browser_version = browser?.browser?.version ?? "0";
|
1998
2199
|
const lang = window.navigator["userLanguage"] || window.navigator.language;
|
@@ -2279,9 +2480,15 @@ var no_default = 'data:image/svg+xml,<svg width="18" height="19" viewBox="0 0 18
|
|
2279
2480
|
|
2280
2481
|
export {
|
2281
2482
|
useTranslation,
|
2483
|
+
useI18nextContext,
|
2282
2484
|
AnalyticsContext,
|
2283
2485
|
AnalyticsContextProvider_default,
|
2284
2486
|
fingerprint_default,
|
2487
|
+
startTracker,
|
2488
|
+
trackEvent,
|
2489
|
+
endTracker,
|
2490
|
+
endTrackerVisibilityState,
|
2491
|
+
unBlockScripts,
|
2285
2492
|
agreeConsents,
|
2286
2493
|
loadGtagScript,
|
2287
2494
|
loadGtmScript,
|
package/dist/index.js
CHANGED
@@ -1,19 +1,17 @@
|
|
1
|
-
import {
|
2
|
-
endTracker,
|
3
|
-
endTrackerVisibilityState,
|
4
|
-
startTracker,
|
5
|
-
trackEvent
|
6
|
-
} from "./chunk-YOHHSMUP.js";
|
7
1
|
import {
|
8
2
|
AnalyticsContext,
|
9
3
|
AnalyticsContextProvider_default,
|
10
4
|
bg_default,
|
5
|
+
endTracker,
|
6
|
+
endTrackerVisibilityState,
|
11
7
|
fingerprint_default,
|
12
8
|
getConsentTemplate,
|
13
9
|
no_default,
|
14
10
|
privacy_default,
|
11
|
+
startTracker,
|
12
|
+
trackEvent,
|
15
13
|
useTranslation
|
16
|
-
} from "./chunk-
|
14
|
+
} from "./chunk-NKOHXSTE.js";
|
17
15
|
|
18
16
|
// src/AnalyticsNext/index.tsx
|
19
17
|
import React2, { useEffect as useEffect2, useState as useState2 } from "react";
|
@@ -76,8 +74,8 @@ var handle_default = AnalyticsHandle;
|
|
76
74
|
|
77
75
|
// src/AnalyticsNext/index.tsx
|
78
76
|
import dynamic from "next/dynamic";
|
79
|
-
var ConsentComponent = dynamic(() => import("./Consent-
|
80
|
-
var ConsentComponentCustom = dynamic(() => import("./ConsentCustom-
|
77
|
+
var ConsentComponent = dynamic(() => import("./Consent-5U2D4TQI.js"), { ssr: false });
|
78
|
+
var ConsentComponentCustom = dynamic(() => import("./ConsentCustom-JINUMJZ5.js"), { ssr: false });
|
81
79
|
var AnalyticsNext = ({
|
82
80
|
router,
|
83
81
|
attributes,
|
@@ -180,8 +178,8 @@ var AnalyticsHandle2 = ({ location, history, children }) => {
|
|
180
178
|
var handle_default2 = AnalyticsHandle2;
|
181
179
|
|
182
180
|
// src/AnalyticsReact/index.tsx
|
183
|
-
var ConsentComponent2 = React4.lazy(() => import("./Consent-
|
184
|
-
var ConsentComponentCustom2 = React4.lazy(() => import("./ConsentCustom-
|
181
|
+
var ConsentComponent2 = React4.lazy(() => import("./Consent-5U2D4TQI.js"));
|
182
|
+
var ConsentComponentCustom2 = React4.lazy(() => import("./ConsentCustom-JINUMJZ5.js"));
|
185
183
|
var AnalyticsReact = ({
|
186
184
|
location,
|
187
185
|
history,
|
@@ -241,7 +239,7 @@ var AnalyticsReact_default = AnalyticsReact;
|
|
241
239
|
// src/Components/OptInConsent.tsx
|
242
240
|
import React5, { useEffect as useEffect5, useState as useState4 } from "react";
|
243
241
|
import { Button, Form } from "react-bootstrap";
|
244
|
-
var endpoint = window["aesirx1stparty"] ? window["aesirx1stparty"] : process?.env?.NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL ? process?.env?.NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL : process?.env?.REACT_APP_ENDPOINT_ANALYTICS_URL ? process?.env?.REACT_APP_ENDPOINT_ANALYTICS_URL : "";
|
242
|
+
var endpoint = typeof window !== "undefined" && window["aesirx1stparty"] ? window["aesirx1stparty"] : process?.env?.NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL ? process?.env?.NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL : process?.env?.REACT_APP_ENDPOINT_ANALYTICS_URL ? process?.env?.REACT_APP_ENDPOINT_ANALYTICS_URL : "";
|
245
243
|
var OptInConsent = ({
|
246
244
|
optInConsentData = window?.optInConsentData ? JSON.parse(window?.optInConsentData) : []
|
247
245
|
}) => {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "aesirx-analytics",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.3.1",
|
4
4
|
"license": "GPL-3.0-only",
|
5
5
|
"author": "AesirX",
|
6
6
|
"repository": "https://gitlab.redweb.dk/aesirx/analytics",
|
@@ -9,13 +9,13 @@
|
|
9
9
|
"types": "dist/index.d.ts",
|
10
10
|
"type": "module",
|
11
11
|
"dependencies": {
|
12
|
-
"@concordium/browser-wallet-api-helpers": "
|
13
|
-
"@concordium/react-components": "
|
14
|
-
"@concordium/web-sdk": "
|
12
|
+
"@concordium/browser-wallet-api-helpers": "3.0.1",
|
13
|
+
"@concordium/react-components": "0.4.0-rc.7",
|
14
|
+
"@concordium/web-sdk": "7.0.4-rc.3",
|
15
15
|
"@web3modal/ethereum": "^2.7.0",
|
16
16
|
"@web3modal/react": "^2.7.0",
|
17
|
-
"aesirx-sso": "^1.4.
|
18
|
-
"axios": "^1.
|
17
|
+
"aesirx-sso": "^1.4.18",
|
18
|
+
"axios": "^1.7.4",
|
19
19
|
"bootstrap": "^5.3.2",
|
20
20
|
"bowser": "^2.11.0",
|
21
21
|
"buffer": "^6.0.3",
|
@@ -23,13 +23,14 @@
|
|
23
23
|
"i18next": "^23.6.0",
|
24
24
|
"i18next-browser-languagedetector": "^7.2.1",
|
25
25
|
"murmurhash-js": "^1.0.0",
|
26
|
-
"next": "^14.
|
26
|
+
"next": "^14.2.10",
|
27
27
|
"query-string": "^7.1.1",
|
28
28
|
"react": "^18.3.1",
|
29
29
|
"react-bootstrap": "^2.8.0",
|
30
30
|
"react-content-loader": "^7.0.0",
|
31
31
|
"react-device-detect": "^2.2.3",
|
32
32
|
"react-dom": "18",
|
33
|
+
"react-select": "^5.8.0",
|
33
34
|
"react-toastify": "^9.1.3",
|
34
35
|
"wagmi": "^1.3.2"
|
35
36
|
},
|
@@ -87,12 +88,17 @@
|
|
87
88
|
"react-i18next": "^13.1.2",
|
88
89
|
"ts-jest": "^29.0.5",
|
89
90
|
"tsup": "^7.2.0",
|
90
|
-
"typescript": "
|
91
|
+
"typescript": "5.1.6"
|
91
92
|
},
|
92
93
|
"files": [
|
93
94
|
"dist"
|
94
95
|
],
|
95
96
|
"resolutions": {
|
96
|
-
"postcss": "^8"
|
97
|
+
"postcss": "^8",
|
98
|
+
"ws": "8.17.1",
|
99
|
+
"@walletconnect/core": "2.9.1",
|
100
|
+
"@walletconnect/types": "2.9.1",
|
101
|
+
"@walletconnect/sign-client": "2.9.1",
|
102
|
+
"rollup": "3.29.5"
|
97
103
|
}
|
98
104
|
}
|
package/dist/chunk-YOHHSMUP.js
DELETED
@@ -1,182 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
fingerprint_default
|
3
|
-
} from "./chunk-NTEWP6UQ.js";
|
4
|
-
|
5
|
-
// src/utils/services.ts
|
6
|
-
var cache;
|
7
|
-
var assign = (a, b) => {
|
8
|
-
Object.keys(b).forEach((key) => {
|
9
|
-
if (b[key] !== void 0)
|
10
|
-
a[key] = b[key];
|
11
|
-
});
|
12
|
-
return a;
|
13
|
-
};
|
14
|
-
var trackerService = async (endpoint, payload) => {
|
15
|
-
const fetchData = await fetch(endpoint, {
|
16
|
-
method: "POST",
|
17
|
-
body: JSON.stringify(payload),
|
18
|
-
headers: assign({ "Content-Type": "application/json" }, { ["x-tracker-cache"]: cache })
|
19
|
-
});
|
20
|
-
const response = await fetchData.json();
|
21
|
-
if (response.error) {
|
22
|
-
throw response.error;
|
23
|
-
} else {
|
24
|
-
return response;
|
25
|
-
}
|
26
|
-
};
|
27
|
-
|
28
|
-
// src/utils/index.ts
|
29
|
-
import Bowser from "bowser";
|
30
|
-
var createRequest = (endpoint, task) => {
|
31
|
-
return `${endpoint}/visitor/v1/${task}`;
|
32
|
-
};
|
33
|
-
var createRequestV2 = (endpoint, task) => {
|
34
|
-
return `${endpoint}/visitor/v2/${task}`;
|
35
|
-
};
|
36
|
-
var rememberFlow = (endpoint, flow) => {
|
37
|
-
return `${endpoint}/remember_flow/${flow}`;
|
38
|
-
};
|
39
|
-
var startTracker = async (endpoint, url, referer, user_agent, attributesVisit) => {
|
40
|
-
const allow = sessionStorage.getItem("aesirx-analytics-allow");
|
41
|
-
const reject = sessionStorage.getItem("aesirx-analytics-rejected");
|
42
|
-
if (allow === "0" || reject === "true") {
|
43
|
-
return null;
|
44
|
-
}
|
45
|
-
const { location, document: document2 } = window;
|
46
|
-
const { pathname, search, origin } = location;
|
47
|
-
url = `${origin}${pathname}${search}`;
|
48
|
-
referer = referer ? location.protocol + "//" + location.host + referer : document2.referrer ? document2.referrer : window["referer"] ? window["referer"] === "/" ? location.protocol + "//" + location.host : location.protocol + "//" + location.host + window["referer"] : "";
|
49
|
-
user_agent = window.navigator.userAgent;
|
50
|
-
const browser = Bowser.parse(window.navigator.userAgent);
|
51
|
-
const browser_name = browser?.browser?.name;
|
52
|
-
const browser_version = browser?.browser?.version ?? "0";
|
53
|
-
const lang = window.navigator["userLanguage"] || window.navigator.language;
|
54
|
-
const device = browser?.platform?.model ?? browser?.platform?.type;
|
55
|
-
const queryString = window.location.search;
|
56
|
-
const urlParams = new URLSearchParams(queryString);
|
57
|
-
const ip = "";
|
58
|
-
try {
|
59
|
-
const fingerprint = fingerprint_default();
|
60
|
-
const attributes = [];
|
61
|
-
for (const key of urlParams.keys()) {
|
62
|
-
if (key.startsWith("utm_")) {
|
63
|
-
urlParams.get(key) && attributes.push({ name: key, value: urlParams.get(key) });
|
64
|
-
}
|
65
|
-
}
|
66
|
-
if (attributesVisit?.length) {
|
67
|
-
attributesVisit?.forEach((element) => {
|
68
|
-
element?.name && attributes.push({ name: element?.name, value: element?.value });
|
69
|
-
});
|
70
|
-
}
|
71
|
-
const responseStart = await trackerService(createRequestV2(endpoint, "start"), {
|
72
|
-
fingerprint,
|
73
|
-
url: url?.replace(/^(https?:\/\/)?(www\.)?/, "$1"),
|
74
|
-
...referer && (referer !== url || document2.referrer) && {
|
75
|
-
referer: referer !== url ? referer?.replace(/^(https?:\/\/)?(www\.)?/, "$1") : document2.referrer?.replace(/^(https?:\/\/)?(www\.)?/, "$1")
|
76
|
-
},
|
77
|
-
user_agent,
|
78
|
-
ip,
|
79
|
-
browser_name,
|
80
|
-
browser_version,
|
81
|
-
lang,
|
82
|
-
device: device?.includes("iPhone") ? "mobile" : device?.includes("iPad") ? "tablet" : device,
|
83
|
-
...attributes?.length && {
|
84
|
-
event_name: "visit",
|
85
|
-
event_type: "action",
|
86
|
-
attributes
|
87
|
-
}
|
88
|
-
});
|
89
|
-
if (window["aesirxTrackEcommerce"] === "true" && sessionStorage.getItem("aesirx-analytics-flow") !== (await responseStart)?.flow_uuid) {
|
90
|
-
sessionStorage.setItem("aesirx-analytics-flow", (await responseStart)?.flow_uuid);
|
91
|
-
try {
|
92
|
-
await trackerService(
|
93
|
-
rememberFlow(window.location.origin, (await responseStart)?.flow_uuid),
|
94
|
-
{}
|
95
|
-
);
|
96
|
-
} catch (error) {
|
97
|
-
console.log("Remember Flow Error", error);
|
98
|
-
}
|
99
|
-
}
|
100
|
-
return responseStart;
|
101
|
-
} catch (error) {
|
102
|
-
console.error("Analytics Error: ", error);
|
103
|
-
}
|
104
|
-
};
|
105
|
-
var trackEvent = async (endpoint, referer, data) => {
|
106
|
-
const allow = sessionStorage.getItem("aesirx-analytics-allow");
|
107
|
-
const reject = sessionStorage.getItem("aesirx-analytics-rejected");
|
108
|
-
if (allow === "0" || reject === "true") {
|
109
|
-
return null;
|
110
|
-
}
|
111
|
-
const { location, document: document2 } = window;
|
112
|
-
referer = referer ? location.protocol + "//" + location.host + referer : document2.referrer ? document2.referrer : window["referer"] ? window["referer"] === "/" ? location.protocol + "//" + location.host : location.protocol + "//" + location.host + window["referer"] : "";
|
113
|
-
const url = location.protocol + "//" + location.host + location.pathname;
|
114
|
-
const user_agent = window.navigator.userAgent;
|
115
|
-
const browser = Bowser.parse(window.navigator.userAgent);
|
116
|
-
const browser_name = browser?.browser?.name;
|
117
|
-
const browser_version = browser?.browser?.version ?? "0";
|
118
|
-
const lang = window.navigator["userLanguage"] || window.navigator.language;
|
119
|
-
const device = browser?.platform?.model ?? browser?.platform?.type;
|
120
|
-
const ip = "";
|
121
|
-
const fingerprint = fingerprint_default();
|
122
|
-
const headers = { type: "application/json" };
|
123
|
-
const blobData = new Blob(
|
124
|
-
[
|
125
|
-
JSON.stringify({
|
126
|
-
fingerprint,
|
127
|
-
url: url?.replace(/^(https?:\/\/)?(www\.)?/, "$1"),
|
128
|
-
...referer !== "/" && referer && {
|
129
|
-
referer: referer?.replace(/^(https?:\/\/)?(www\.)?/, "$1")
|
130
|
-
},
|
131
|
-
user_agent,
|
132
|
-
ip,
|
133
|
-
browser_name,
|
134
|
-
browser_version,
|
135
|
-
lang,
|
136
|
-
device: device?.includes("iPhone") ? "mobile" : device?.includes("iPad") ? "tablet" : device,
|
137
|
-
...data
|
138
|
-
})
|
139
|
-
],
|
140
|
-
headers
|
141
|
-
);
|
142
|
-
const responseStart = navigator.sendBeacon(createRequestV2(endpoint, "start"), blobData);
|
143
|
-
return responseStart;
|
144
|
-
};
|
145
|
-
var endTracker = (endPoint, event_uuid, visitor_uuid) => {
|
146
|
-
if (event_uuid && visitor_uuid) {
|
147
|
-
const body = {
|
148
|
-
event_uuid,
|
149
|
-
visitor_uuid
|
150
|
-
};
|
151
|
-
const headers = { type: "application/json" };
|
152
|
-
const blob = new Blob([JSON.stringify(body)], headers);
|
153
|
-
navigator.sendBeacon(createRequest(endPoint, "end"), blob);
|
154
|
-
}
|
155
|
-
};
|
156
|
-
var endTrackerVisibilityState = (endPoint) => {
|
157
|
-
document.addEventListener("visibilitychange", async () => {
|
158
|
-
if (document.visibilityState === "hidden") {
|
159
|
-
endTracker(endPoint, window["event_uuid"], window["visitor_uuid"]);
|
160
|
-
}
|
161
|
-
if (document.visibilityState === "visible") {
|
162
|
-
const response = await startTracker(endPoint, "", "", "", window["attributes"]);
|
163
|
-
window["event_uuid"] = response?.event_uuid;
|
164
|
-
}
|
165
|
-
});
|
166
|
-
window.addEventListener(
|
167
|
-
"pagehide",
|
168
|
-
(event) => {
|
169
|
-
if (event.persisted) {
|
170
|
-
endTracker(endPoint, window["event_uuid"], window["visitor_uuid"]);
|
171
|
-
}
|
172
|
-
},
|
173
|
-
false
|
174
|
-
);
|
175
|
-
};
|
176
|
-
|
177
|
-
export {
|
178
|
-
startTracker,
|
179
|
-
trackEvent,
|
180
|
-
endTracker,
|
181
|
-
endTrackerVisibilityState
|
182
|
-
};
|