Giter Site home page Giter Site logo

electron-google-analytics's People

Contributors

dependabot[bot] avatar mbackonja avatar please-wait avatar tristansokol avatar vacu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

electron-google-analytics's Issues

It doesn't work.

The lib seems not to work for me. I checked the test file and it passed with no matter TRACKING_ID is. When I passed random string for the TRACKING_ID, the test still passes, no requests got failed, which is super weird.

I tried passing the UA-... id from my G.A and make some event requests, nothing happened.

Suggestions

While working on the PR to convert this repo to typescript, I found a few things that perhaps could be improved.

For instance:

  • Add lib to .gitignore
  • Give the user the ability to specify their own globalBaseURL and globalCollectURL
  • Give the user the ability to send in options to electron-fetch (useful for proxy stuff etc)
  • globalBatchURL is unused. Should it be used or removed?
  • A lot of the parameter names are needlessly abbreviated. It just makes it harder for the user to use them.
  • This lib would be easier to use if you could send in all parameters as objects. It would also give nicer type interfaces.

Can'tset clientID

Hi everyone. I'm using

const Analytics  = require('electron-google-analytics');
const analytics = new Analytics.default('UA-87670043-6');
analytics.set('uid', 123);

and I'm getting this error:
analytics.set is not a function

What am i doing wrong?
Thank you!!!

SyntaxError: Unexpected token o in JSON at position 1

Hello, I am using electron-google-analytics in my Electron app that also uses React, Redux and Parcel. The electron-google-analytics instance is initialized using a "web + app" property, so it uses a Measurement ID starting with G- instead of a Tracking ID starting with UA-.

When I try to send any data to Google Analytics, such as analytics.screen() or analytics.event(), the response returned from calling the function is

SyntaxError: Unexpected token o in JSON at position 1

Where did I go wrong?

Additionally, when I use a Tracking ID instead of a Measurement ID, the same error occurs but at least the events are being recorded by Google Analytics. However, events logged using analytics.screen() does not appear to show up anywhere in the Google Analytics app. Does this module not work with Measurement IDs?

Thank you!

const analytics = new Analytics('G-XXXXXXXXXX');

analytics.set('clientID', state.user.clientId);
analytics.set('uid', state.user.uid);
analytics.set('appName', appName);
analytics.set('appVersion', appVersion);

// Intentionally passing these strings to `analytics.screen()`
const response = await analytics.screen('appName', 'appVersion', 'appId', 'appInstallerId', 'location.pathname');
console.log(response);

gives the following error in the electron app JS console

SyntaxError: Unexpected token o in JSON at position 1
    at index.js:591

image

System Environment

Missing typings?

I can't import this. There are no typings. It would be really awesome if you added typings or how to install them to the docs. All commands are for typescript and then typings installation is missing. Really a bummer.

Ability to send custom parameters

It will be nice to have ability to send custom params.

Current api:

Analytics#event(evCategory, evAction, { evLabel, evValue, clientID })

Proposition to add one more way (raw data):

Analytics.event({
  sr: '800x600',
  ul: 'en-US',
  av: '1.1.1',
  ...
})

Tracking Id

Hi,
The documentation doesn't specify the how and which tracking id should I create to start using google analytics
what tracking id should I create for electron app? I can only create tracking id for a website or a mobile app.
can you please explain?

Deprecated packages need updating

When installing/updating electron-google-analytics using yarn, I get the warning messages:

warning electron-google-analytics > @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
warning electron-google-analytics > @babel/polyfill > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

Can package.json be updated to address these warnings please? I am curently on [email protected]. Thank you!

GA 4 measurement ID can be instead of UA-XXX id

Hello,

I wanted to use Google Analytics 4 in my electron app, but it seems that because file:// protocol I can not use it as expected.

Proposed solution:
one of the solutions can be UA-XXXX id can be replaced with GA-XXXXX to let developers use Google Analytics measurement ID instead of Universal Analytics Id.

More information can be found here.

With no session duration defined in pageviews call, pageviews fail to track at all

When you are tracking events using the suggested code examples, such as:

GA.pageview('ApplicationName', '/' + path, path, clientId);

The page views will never be tracked. You have to explicitly set the fourth parameter sessDuration as undefined, like so:

GA.pageview('ApplicationName', '/' + path, path, undefined, clientId);

Then all pageviews will be tracked properly. We experienced a major metrics issue due to this.

Documentation customdimensions

Great work, was curious if there was any documentation or functionality for using custom dimensions when sending events or pageviews, or setting a custom dimension for the user or session.

Thanks!

Typescript Support

Hello @vacu ,

I found this project very interesting due to the fact that it's main focused is for electron apps.
I loved electron and I built one named productivity-timer which is an open source too.

I used universal-analytics for my project.
I want to try this library too but the problem is the typescript support.

Do you have a plan to support typescript too?

Thank you for any response.

Seeting up Google Analyltics

Thanks for working on this! I have a quick question. For using your lib one should set up the GA account as a website or as a mobile application?

screen shot 2017-03-15 at 17 29 38

No session > Meaning 1 pageview === 1 user :(

Hey!

Love your module so far but I have a problem with session basically each time I run analytics.pageview(), a user ID is regenerated and I get one new user in google analytics.
Meaning it is not possible to know how many people are using the app and that's a problem! :(

Any way we could fix that?

--Etienne

UPDATE: my bad.. I did not see the
"If you want to keep the session you need to specify the clientID."
haha! All good then!
Thanks again for your work! Your rock! 👍 💯

Session Duration 0

When using this module the seassion duration in GA dashboard is always 0. How do I fix it? I only use pageview in each screen. My Electron app is a single page app built mostly with React.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.