Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Google Analytics v2 API #1695

Closed
ekoz opened this issue Dec 24, 2021 · 6 comments
Closed

How to use Google Analytics v2 API #1695

ekoz opened this issue Dec 24, 2021 · 6 comments
Labels
semver-major This needs a major release

Comments

@ekoz
Copy link
Contributor

ekoz commented Dec 24, 2021

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

1640327720(1)

What does the proposed API look like?

How should this be implemented in your opinion?

Are you willing to work on this yourself?

Yes

@trusktr
Copy link
Member

trusktr commented Dec 24, 2021

Hello, not sure what issue you're having. Did you try https://docsify.js.org/#/plugins?id=google-analytics ?

@trusktr trusktr added the wait for information something is not clear, waiting for the author of the issue/pr label Dec 25, 2021
@ekoz
Copy link
Contributor Author

ekoz commented Dec 28, 2021

@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

@trusktr
Copy link
Member

trusktr commented Dec 29, 2021

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.

@trusktr
Copy link
Member

trusktr commented Dec 29, 2021

Also if you post a live example, that'd help. I'm not experienced with ga.

@ekoz
Copy link
Contributor Author

ekoz commented Dec 29, 2021

@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.

idmarjr added a commit to brmodeloweb/brmodelo-docs that referenced this issue Jan 17, 2022
Google analytics is not tracking user activity.
Based in a brief research, this is related to the version of GA API
being called from Ga plugin.

New GA codies are using V2 but the pluging calls V1.

In an attempt to fix this, I'm adding a loca ga-temp.js and using it
instead of CDN oficial version

Not sure if this will solve the issue but worth the attempt

You can find more information about the issue here:
docsifyjs/docsify#1695
@idmarjr
Copy link

idmarjr commented Mar 15, 2022

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?

andreynering added a commit to go-task/task that referenced this issue May 9, 2022
ekoz pushed a commit to ekoz/docsify that referenced this issue Aug 2, 2022
idmarjr added a commit to brmodeloweb/brmodelo-docs that referenced this issue Sep 25, 2022
- The new GA4 tracking code is still  not working with the official plugin
- To know more: docsifyjs/docsify#1695
rishubil added a commit to sce-tts/sce-tts.github.io that referenced this issue Jun 19, 2023
@sy-records sy-records added semver-major This needs a major release and removed wait for information something is not clear, waiting for the author of the issue/pr labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major This needs a major release
Projects
None yet
Development

No branches or pull requests

4 participants