GithubHelp home page GithubHelp logo

isabella232 / browserslist-ga-export Goto Github PK

View Code? Open in Web Editor NEW

This project forked from browserslist/browserslist-ga-export

0.0 0.0 0.0 22 KB

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

License: MIT License

JavaScript 100.00%

browserslist-ga-export's Introduction

browserslist-ga-export

Overview

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

browserslist-ga-export allows you to generate the same Browserslist custom usage data file 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. You may optionally provide multiple CSV files to generate a custom usage data file representing the merged data of multiple views.

Installation

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

Usage

1) Check user language setting

Ensure that language is set to "English (United States)" in user language settings. See #5 and #14 for an explanation of why this is necessary.

2) Create custom report

Create a custom report with the specifications listed below. You will be able to use this custom report for one or more desired Google Analytics view(s) associated with a Google Analytics account.

  • Type: Flat Table
  • Dimensions (in this order):
    1. Operating System
    2. Operating System Version
    3. Browser
    4. Browser Version
    5. Device Category
  • Metrics: Pageviews

3) Export custom report CSV file(s)

For each desired view, follow these steps to export the custom report as a CSV file:

  1. View the custom report.
  2. Sort the report by Browser column ascending alphabetically (arrow in column header facing up).
  3. Select the desired date range for the report.
  4. Show 5000 rows for the report.
  5. Export the report as a CSV file.

4) Convert CSV file(s) into custom usage data file

Use the browserslist-ga-export CLI to convert the CSV file(s) into a custom usage data file (browserslist-stats.json by default). See CLI documentation for more details.

browserslist-ga-export --reportPath {String} [options]

CLI

Commands

browserslist-ga-export

Create or update a custom usage data JSON file from one or more report CSV files given a report path and an output path.

Options

--reportPath (-r)

Path or glob path pattern of report CSV file(s) to process.

  • Required
  • Type: string

--ignoreRows (-i)

Number of rows at beginning of report CSV file(s) to exclude from processing. Default value is based on the default format of Google Analytics custom report CSV exports.

  • Optional
  • Type: number
  • Default: 7

--outputPath (-o)

Output path for generated custom usage data file.

  • Optional
  • Type: string
  • Default: 'browserslist-stats.json'

Examples

browserslist-ga-export --reportPath browserslist-report.csv
browserslist-ga-export -r browserslist-reports/*.csv
browserslist-ga-export -r browser-report.csv -o browser-stats.json
browserslist-ga-export -r browser-report.csv -i 0

browserslist-ga-export's People

Contributors

galvarez421 avatar danez avatar salimbensiali avatar

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.