💄 Support more of analytics engine such as baidu, google, busuanzi and so on, then add new web information widget. close #19
This commit is contained in:
@@ -12,6 +12,6 @@
|
||||
{{ end }}
|
||||
}
|
||||
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
</script>
|
||||
|
||||
11
layouts/partials/_thirdparty/analytics/baidu.html
vendored
Normal file
11
layouts/partials/_thirdparty/analytics/baidu.html
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
var script = document.createElement('script');
|
||||
|
||||
script.charset = "UTF-8";
|
||||
script.src = "{{ .Site.Data.resources.analytics.baidu }}{{ .Site.Params.analytics.baidu }}";
|
||||
script.async = "true"
|
||||
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
</script>
|
||||
11
layouts/partials/_thirdparty/analytics/busuanzi.html
vendored
Normal file
11
layouts/partials/_thirdparty/analytics/busuanzi.html
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
var script = document.createElement('script');
|
||||
|
||||
script.charset = "UTF-8";
|
||||
script.src = "{{ .Site.Data.resources.analytics.busuanzi }}";
|
||||
script.async = "true"
|
||||
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
</script>
|
||||
18
layouts/partials/_thirdparty/analytics/google.html
vendored
Normal file
18
layouts/partials/_thirdparty/analytics/google.html
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
var script = document.createElement('script');
|
||||
|
||||
script.charset = "UTF-8";
|
||||
script.src = "{{ .Site.Data.resources.analytics.google }}{{ .Site.Params.analytics.google }}";
|
||||
script.async = "true"
|
||||
script.onload = function() {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '{{ .Site.Params.analytics.google }} ');
|
||||
}
|
||||
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user