Socket
Socket
Sign inDemoInstall

browserslist-ga-export

Package Overview
Dependencies
147
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    browserslist-ga-export

Generate browserslist-stats.json using Browserslist-GA without logging into a Google Account


Version published
Weekly downloads
4.4K
increased by3.54%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

browserslist-ga-export

Generate browserslist-stats.json using Browserslist-GA without logging into a Google Account.

browserslist-ga-export allows you to generate the same browserslist-stats.json that Browserslist-GA would generate for a Google Analytics view without requiring you to log into a Google Account. Instead of logging into a Google Account, you must provide a CSV export of a Google Analytics custom report.

Installation

If you are using npm:

$ npm install --save-dev browserslist-ga-export

If you are using Yarn:

$ yarn add --dev browserslist-ga-export

Usage

1) Export custom report as CSV

  1. Create a custom report for the desired Google Analytics view using the format below (the language you see in Google Analytics may vary depending on your user language settings):
    • Type: Flat Table
    • Dimensions (in this order):
      1. Operating System
      2. Operating System Version
      3. Browser
      4. Browser Version
      5. Device Category
    • Metrics: Pageviews or Page Views
  2. View the report.
  3. Sort the report by Browser column ascending alphabetically (arrow in column header facing up).
  4. Select the desired date range for the report.
  5. Show 5000 rows for the report.
  6. Export the report as a CSV.

2) Convert CSV into browserslist-stats.json

If you are using npm v5.2.0 or higher:

$ npx browserslist-ga-export --reportPath {path-to-export}.csv

If you are using Yarn:

$ yarn browserslist-ga-export --reportPath {path-to-export}.csv

You can also add a script to package.json, for example:

"scripts": {
  "update-browserslist-stats": "browserslist-ga-export --reportPath {path-to-export}.csv"
}

3) Query against your custom usage data

CLI Options

NameTypeDefaultDescription
ignoreRows{Number}7Number of rows at beginning of CSV file to exclude from data passed to Browserslist-GA. The default value is based on the default format of Google Analytics custom report CSV exports.
outputPath{String}'browserslist-stats.json'Path for exported browserslist-stats file.
reportPath{String}nullPath of report CSV to process.

Keywords

FAQs

Last updated on 18 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc