Skip to content

Commit 103dde8

Browse files
committed
Merge branch 'develop' into delete-ssr
* develop: feat: add google analytics gtag.js plugin (#1702) chore: bump conventional-changelog-cli from 2.2.2 to 3.0.0 (#2085)
2 parents 8d5d204 + 29f3c82 commit 103dde8

File tree

6 files changed

+538
-445
lines changed

6 files changed

+538
-445
lines changed

build/build.js

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ async function buildAllPlugin() {
7979
var plugins = [
8080
{name: 'search', input: 'search/index.js'},
8181
{name: 'ga', input: 'ga.js'},
82+
{name: 'gtag', input: 'gtag.js'},
8283
{name: 'matomo', input: 'matomo.js'},
8384
{name: 'emoji', input: 'emoji.js'},
8485
{name: 'external-script', input: 'external-script.js'},

docs/plugins.md

+27
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ This plugin ignores diacritical marks when performing a full text search (e.g.,
7171

7272
## Google Analytics
7373

74+
> Google's Universal Analytics service will no longer process new data in standard properties beginning July 1, 2023. Prepare now by setting up and switching over to a Google Analytics 4 property and docsify's gtag.js plugin.
75+
7476
Install the plugin and configure the track id.
7577

7678
```html
@@ -91,6 +93,31 @@ Configure by `data-ga`.
9193
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/ga.min.js"></script>
9294
```
9395

96+
## Google Analytics 4 (GA4)
97+
98+
Install the plugin and configure the track id.
99+
100+
```html
101+
<script>
102+
// Single ID
103+
window.$docsify = {
104+
gtag: 'UA-XXXXX-Y',
105+
};
106+
107+
// Multiple IDs
108+
window.$docsify = {
109+
gtag: [
110+
'G-XXXXXXXX', // Google Analytics 4 (GA4)
111+
'UA-XXXXXXXX', // Google Universal Analytics (GA3)
112+
'AW-XXXXXXXX', // Google Ads
113+
'DC-XXXXXXXX', // Floodlight
114+
],
115+
};
116+
</script>
117+
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
118+
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/gtag.min.js"></script>
119+
```
120+
94121
## Emoji
95122

96123
Renders a larger collection of emoji shorthand codes. Without this plugin, Docsify is able to render only a limited number of emoji shorthand codes.

0 commit comments

Comments
 (0)