Browse Source

Merge branch 'hotfix/ya-metrics'

Book Pauk 6 năm trước cách đây
mục cha
commit
a1b0ffe2c9
2 tập tin đã thay đổi với 17 bổ sung1 xóa
  1. 16 0
      client/components/App.vue
  2. 1 1
      package.json

+ 16 - 0
client/components/App.vue

@@ -208,6 +208,22 @@ class App extends Vue {
                 this.$router.replace('/reader');
             }
         }
+
+        //yandex-метрика для omnireader
+        if (this.mode == 'omnireader' && !this.yaMetricsDone) {
+            (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
+            m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
+            (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");// eslint-disable-line no-unexpected-multiline
+
+            ym(52347334, "init", {// eslint-disable-line no-undef
+                id:52347334,
+                clickmap:true,
+                trackLinks:true,
+                accurateTrackBounce:true
+            });
+
+            this.yaMetricsDone = true;
+        }
     }
 }
 //-----------------------------------------------------------------------------

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "Liberama",
-  "version": "0.1.0",
+  "version": "0.1.1",
   "engines": {
     "node": ">=10.0.0"
   },