docsify
docsify copied to clipboard
How to use Google Analytics v2 API
Feature request
What problem does this feature solve?
I use ga plugin, set the right ga code, but Google Analytics can not recived data, ga.min.js request param is v=1, but Google Analytics gtag.js request param is v=2

What does the proposed API look like?
How should this be implemented in your opinion?
Are you willing to work on this yourself?
Yes
Hello, not sure what issue you're having. Did you try https://docsify.js.org/#/plugins?id=google-analytics ?
@trusktr yes, I use ga plugin like this:
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js" data-ga="UA-XXXXX-Y"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/ga.min.js"></script>
but in did, the http request param is v1 version, but Google Analytics api need v2 version
Do you mean we need a ga2.js plugin, that calls v2 APIs? It should be fairly simple if you want to make it. The code is short:
https://github.com/docsifyjs/docsify/blob/develop/src/plugins/ga.js
If you can submit a new ga2.js, that'd be awesome.
Also if you post a live example, that'd help. I'm not experienced with ga.
@trusktr Thanks for your reply, maybe my description is not accurate enough. I checked the code script carefully, the v1 code script src is https://www.google-analytics.com/analytics.js, the v2 code script src is https://www.googletagmanager.com/gtag/js?id=xxx, and I use ga plugin, so it is not work. I will try to write the gtag plugin, and create merge request to u.
Hello folks!
I can see #1702 have a test failing and it does not see any action for few months. Can I help somehow?
Also, there's any documented work around to make Google Analytics work meanwhile?