SDKBox for web on Cocos Creator

Hello!

I’m new in Cocos development and I started a prototype of a Web game using Cocos Creator. When I was reviewing what features will be used, I saw that it would be necessary to integrate Google Analytics.

After some research, I discovered that the SDKBox has no support for Web builds (SDKBOX with JavaScript on the web), and now I’m trying to discover how I’ll integrate Google Analytics (or another good Analytics) for this Web Projects using Cocos Creator… Anyone have any idea how to do it?

Thanks in advance! :relaxed:

Bruno Meneghetti

Oh, I forgot! The project will probably integrate Facebook as well…

I guess you can do it like this: Charts external library - Cocos Creator - Cocos Forums

Hello Bruno,

Lucky you, I just spent the last 2 days trying to integrate Google Analytics in my project and eventually found a solution : you can use this NPM module : https://www.npmjs.com/package/universal-ga

Can anyone give us an updated status on using SDKBox with Cocos Creator and web builds ?

2 Likes

I do not have experience with NPM. How can I integrate a NPM module to Creator? I mean, do I have to do something special or just add the analytics.js file to the project and “require(‘analytics’)”?
Thanks!

It is explained here : http://cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/third-party-module/

In short :

  • Install Node JS on your system
  • Type npm install universal-ga in a console
3 Likes

Cool! Thanks!

Thanks Guys!

I’ll try it and return! :grinning:

Well,

I successfully integrated universal-ga on my project, the problem now seems to be with my capacity to configure Google Analytics o work with the app. Thanks again! I’ll keep trying to make this work. :slight_smile: