analysis.js.下载 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // <!-- Google tag (gtag.js) -->
  2. ;(function () {
  3. var hm = document.createElement("script");
  4. hm.async = 1;
  5. hm.src = "https://www.googletagmanager.com/gtag/js?id=G-3GR90RW2M5";
  6. var s = document.getElementsByTagName("script")[0];
  7. s.parentNode.insertBefore(hm, s);
  8. window.dataLayer = window.dataLayer || [];
  9. function gtag() { dataLayer.push(arguments); }
  10. gtag('js', new Date());
  11. gtag('config', 'G-3GR90RW2M5');
  12. })();
  13. // baidu analysis
  14. ; var _hmt = _hmt || [];
  15. (function () {
  16. var hm = document.createElement("script");
  17. hm.src = "https://hm.baidu.com/hm.js?f4b3788b2247dd149fb7fdffe8aece79";
  18. var s = document.getElementsByTagName("script")[0];
  19. s.parentNode.insertBefore(hm, s);
  20. })();
  21. // google analysis
  22. (function (i, s, o, g, r, a, m) {
  23. i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
  24. (i[r].q = i[r].q || []).push(arguments)
  25. }, i[r].l = 1 * new Date(); a = s.createElement(o),
  26. m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
  27. })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
  28. ga('create', 'UA-144903049-2', 'auto');
  29. ga('require', 'GTM-MNBPZXP');
  30. ga('send', 'pageview');
  31. // open in app
  32. ; (function () {
  33. const installTip = document.getElementById('install-tip')
  34. const installTipClose = document.getElementById('install-tip-close')
  35. const href = location.href
  36. if (installTip) {
  37. if (/from=open-app/i.test(href)) {
  38. installTip.style.display = 'flex'
  39. }
  40. installTipClose.onclick = () => {
  41. installTip.style.display = 'none'
  42. }
  43. }
  44. }());