Skip to content
This repository was archived by the owner on Jul 5, 2021. It is now read-only.

Commit

Permalink
chore: setup countly analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
zebateira committed Apr 9, 2021
1 parent a9f004a commit f35961f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ disableKinds = ["RSS"]
social = [ { title = "Twitter", link = "https://twitter.com/ipfs" },
{ title = "Facebook", link = "https://www.facebook.com/sharer/sharer.php?u=https://ipfs.io" },
{ title = "YouTube", link = "https://www.youtube.com/channel/UCdjsUXJ3QawK4O5L1kqqsew" } ]
countly = "507e47cb3b0c4b2aed0d0faba6b80c03d03c445c"
26 changes: 26 additions & 0 deletions layouts/partials/countly.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script type='text/javascript'>
//some default pre init
var Countly = Countly || {};
Countly.q = Countly.q || [];

//provide countly initialization parameters
Countly.app_key = '{{ $.Param "countly" }}';
Countly.url = 'https://countly.ipfs.io';

Countly.q.push(['track_sessions']);
Countly.q.push(['track_pageview']);
Countly.q.push(['track_clicks']);
Countly.q.push(['track_scrolls']);
Countly.q.push(['track_errors']);
Countly.q.push(['track_links']);

//load countly script asynchronously
(function () {
var cly = document.createElement('script'); cly.type = 'text/javascript';
cly.async = true;
//enter url of script here
cly.src = 'web/sdk/web/countly.min.js';
cly.onload = function () { Countly.init() };
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(cly, s);
})();
</script>
6 changes: 6 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@
<script src="https://camp.ipfs.io/ribbon.min.js" async></script>
{{- if not .Site.IsServer -}}
{{ template "_internal/google_analytics_async.html" . }}
<!--
countly analytics
added to compare stats with new website version
see: https://github.com/ipfs/website/issues/422
-->
{{ partial "countly.html" . }}
{{- end -}}

0 comments on commit f35961f

Please sign in to comment.