3DStreet / 3dstreet-editor

3DStreet Editor Repo
https://3dstreet.app
Other
18 stars 3 forks source link

feat(ga): added save scene actions and new account creation #384

Closed rostyslavvnahornyi closed 4 months ago

netlify[bot] commented 6 months ago

Deploy Preview for 3dstreet-editor-builds ready!

Name Link
Latest commit f342bba4784c56ea5eb56dc06ac7ee3ba138d1db
Latest deploy log https://app.netlify.com/sites/3dstreet-editor-builds/deploys/65f21823425bd10008fafc60
Deploy Preview https://deploy-preview-384--3dstreet-editor-builds.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

kfarr commented 5 months ago

Reviewing the code first, it looks like there is a bit more process around sign-in now so that we can do a query to see if a user is logging in for the first time therefore creating an account

kfarr commented 5 months ago

updated from master

other questions:

how to test?

https://firebase.google.com/docs/analytics/debugview#web

kfarr commented 5 months ago

I started testing using the extension suggested above. It confirmed that we were sending events, but not to the development account as expected from the current environment file.

Then I identified that we're still loading GA via index.html https://github.com/3DStreet/3dstreet-editor/blob/master/index.html#L130

Instead we should instantiate google analytics via react / javascript so that we can use env credential. https://github.com/3DStreet/3dstreet-editor/issues/390

Please make these changes on this very PR so we can keep all the google analytics changes together

rostyslavvnahornyi commented 5 months ago

hi @kfarr !

ive added ga via npm package react-ga4 and created new variable in envs "GA_ID". For development im using my GA_ID that i have created before. For production we need to use old GA_ID that stored in index.js at the end of the file.

Also i changed all sending events from native js to sendMetrick() function. Here i ran into a problem that all my click events were not sent to ga servers in local development due to adblockers.  So, If you want to test ga in local just remove all adblockers.

This is the example of metric(export gltf):

image image
kfarr commented 4 months ago

looks great @rostyslavvnahornyi thanks for this and sorry for delayed review