Merge branch 'master' of https://github.com/mmistakes/minimal-mistakes
This commit is contained in:
commit
e7095c49d9
4 changed files with 14 additions and 2 deletions
|
@ -83,7 +83,7 @@ social:
|
||||||
|
|
||||||
# Analytics
|
# Analytics
|
||||||
analytics:
|
analytics:
|
||||||
provider : false # false (default), "google", "google-universal", "custom"
|
provider : false # false (default), "google", "google-universal", "google-gtag", "custom"
|
||||||
google:
|
google:
|
||||||
tracking_id :
|
tracking_id :
|
||||||
|
|
||||||
|
|
9
_includes/analytics-providers/google-gtag.html
Normal file
9
_includes/analytics-providers/google-gtag.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.analytics.google.tracking_id }}"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
|
||||||
|
gtag('config', '{{ site.analytics.google.tracking_id }}');
|
||||||
|
</script>
|
|
@ -5,6 +5,8 @@
|
||||||
{% include /analytics-providers/google.html %}
|
{% include /analytics-providers/google.html %}
|
||||||
{% when "google-universal" %}
|
{% when "google-universal" %}
|
||||||
{% include /analytics-providers/google-universal.html %}
|
{% include /analytics-providers/google-universal.html %}
|
||||||
|
{% when "google-gtag" %}
|
||||||
|
{% include /analytics-providers/google-gtag.html %}
|
||||||
{% when "custom" %}
|
{% when "custom" %}
|
||||||
{% include /analytics-providers/custom.html %}
|
{% include /analytics-providers/custom.html %}
|
||||||
{% endcase %}
|
{% endcase %}
|
||||||
|
|
|
@ -679,13 +679,14 @@ Analytics is disabled by default. To enable globally select one of the following
|
||||||
| -------------------- | --------------------------------------------------------------- |
|
| -------------------- | --------------------------------------------------------------- |
|
||||||
| **google** | [Google Standard Analytics](https://www.google.com/analytics/) |
|
| **google** | [Google Standard Analytics](https://www.google.com/analytics/) |
|
||||||
| **google-universal** | [Google Universal Analytics](https://www.google.com/analytics/) |
|
| **google-universal** | [Google Universal Analytics](https://www.google.com/analytics/) |
|
||||||
|
| **google-gtag** | [Google Analytics Global Site Tag)](https://www.google.com/analytics/) |
|
||||||
| **custom** | Other analytics providers |
|
| **custom** | Other analytics providers |
|
||||||
|
|
||||||
For Google Analytics add your Tracking Code:
|
For Google Analytics add your Tracking Code:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
analytics:
|
analytics:
|
||||||
provider: "google-universal"
|
provider: "google-gtag"
|
||||||
google:
|
google:
|
||||||
tracking_id: "UA-1234567-8"
|
tracking_id: "UA-1234567-8"
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue