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

Can't parse space delimiters in page views count #14

Closed
dkozii opened this issue May 23, 2020 · 3 comments
Closed

Can't parse space delimiters in page views count #14

dkozii opened this issue May 23, 2020 · 3 comments

Comments

@dkozii
Copy link

dkozii commented May 23, 2020

Hi, thanks for such beautiful tool! I've created perfect browserslist-stats.json for my project thanks to this repo.

But at first I recieved only zeros in output file, and as was mentioned in that issue the problem is in space delimiters:
browserslist/browserslist-ga#35 (comment)
Unfortunately, google analytics exports in csv with space delimiters in pageviews if count is more than 1000.

I will send PR with the fix, please take a look at it.

@galvarez421
Copy link
Member

Hi @dkoziy, thank you for the feedback! I'm glad to hear that this tool has been helpful to you.

That is an interesting finding -- I'm surprised the issue has not surfaced before! Given that the row arrays constructed in index.js are passed to the parse method exported by browserslist-ga, I think my preference would be to wait to see if this is something that browserslist-ga should account for, in which case we can wait to inherit the fix when browserslist-ga fixes the issue. However, it's possible that the issue exists only when using this tool (browserslist/browserslist-ga#35 mentions CSV, which makes me wonder if that user is actually using this tool), as is presumably the case with the issue of commas in pageviews strings, in which case I think the fix in your PR would be a great fix.

Out of curiosity, when you export a CSV report in which a row has over 1000 pageviews, are space delimiters used in all cases? Are comma delimiters ever used? May I ask what user language setting you are using in Analytics? I just exported a custom report CSV and I see comma delimiters, so I'm wondering if the delimiter varies by user settings or some other settings.

@dkozii
Copy link
Author

dkozii commented May 29, 2020

At first, I wanted to fix this in https://github.com/browserslist/browserslist-ga. But, unfortunately, I can't use that tool -- when I tried, I got errors like "this application hasn't approved yet". Maybe it is because of my company settings, I don't know. Anyway, I can't use the tool, so I can't confirm that the issue exists there too :)

And looks like your guess about language settings was correct -- format of the exported data and of the report itself depends on user language. In my case, I was using the Russian language, and my reports were looking like this:

Android,9,Chrome,81.0.4044.138,mobile,940 771
Windows,10,Chrome,81.0.4044.138,desktop,559 485

After your comment, I've switched to the English(US) language, and now I see comma delimiters:

Android,9,Chrome,81.0.4044.138,mobile,"940,771"
Windows,10,Chrome,81.0.4044.138,desktop,"559,485"

If you want to try this, notice that user language settings aren't applying immediately -- you need to clear cookies and re-login into your account to see the new language.

@galvarez421
Copy link
Member

Thank you for the feedback and information. I'm starting to think that it will make most sense for me to update the README so that the first usage step is to set user language setting to "English (United States)". I don't think it's feasible at this point to support an indefinite number of languages and the corresponding differences that may result from those language differences. Also, I think having users of this tool change that setting would be easier for the maintenance of the tool as well as for users (the latter due to simpler documentation). This certainly isn't the first time that a difference in language settings has resulted in the tool or its usage not working as expected (see #5). What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants