Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

support google analytics.js(upgrade ga.js) #289

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ JB :
site_id : 'SITE ID'
google :
tracking_id : 'UA-123-12'
googleUA :
tracking_id : 'UA-123-12'
property_name : 'auto'
getclicky :
site_id :
mixpanel :
Expand Down
2 changes: 2 additions & 0 deletions _includes/JB/analytics
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
{% include JB/analytics-providers/gauges %}
{% when "google" %}
{% include JB/analytics-providers/google %}
{% when "googleUA" %}
{% include JB/analytics-providers/google-universal %}
{% when "getclicky" %}
{% include JB/analytics-providers/getclicky %}
{% when "mixpanel" %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/JB/analytics-providers/google-universal
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', {{ site.JB.analytics.googleUA.tracking_id }}', {% if site.JB.analytics.googleUA.property_name %}{{ site.JB.analytics.googleUA.property_name }}{% else %}'auto'{% endif %});
ga('create', {{ site.JB.analytics.googleUA.tracking_id }}', {% if site.JB.analytics.googleUA.property_name %}'{{ site.JB.analytics.googleUA.property_name }}'{% else %}'auto'{% endif %});
ga('send', 'pageview');
</script>