Git Product home page Git Product logo

ga-validator's Introduction

Google Analytics Validator

Google Analytics validator for NodeJs. Easily validate Google Analytics query parameters. It is used extensively in our OOcharts app.

##Usage##

Install gav through npm: npm install ga-validator

gav = require('ga-validator');

//Do stuff...

##Methods##

###getDimension(dim)###

Gets a dimension by GA value.

Arguments

  • dim - A string GA value of form ga:value

Example

gav.getDimension('ga:browser'); //returns { value : 'ga:browser', name : 'Browser', regex : RegExpObject }

###getMetric(met)###

Gets a metric by GA value.

Arguments

  • met - A string GA value of form ga:value

Example

gav.getMetric('ga:visits'); //returns { value : 'ga:visits', name : 'Visits', regex : RegExpObject }

###checkDimension(dim)###

Checks whether a dimension is valid.

Arguments

  • dim - A string GA value of form ga:value

Example

gav.checkDimension('ga:browser'); //returns true
gav.checkDimension('ga:bad'); //returns false

###checkMetric(met)###

Checks whether a metric is valid.

Arguments

  • met - A string GA value of form ga:value

Example

gav.checkMetric('ga:visits'); //returns true
gav.checkMetric('ga:bad'); //returns false

###checkSort(sort)###

Checks whether a sort value is valid.

Arguments

  • sort - A string GA sort value

Example

gav.checkSort('-ga:visits'); //returns true
gav.checkSort('ga:visits'); //returns true

###checkSegment(seg)###

Checks whether a segment value is valid.

Arguments

  • seg - A string GA segment value

Example

gav.checkSegment('gaid::10'); //returns true
gav.checkSegment('dynamic::ga:medium==referral'); //returns true

###checkFilter(filter)###

Checks whether a filter value is valid.

Arguments

  • filter - A string GA filter value

Example

gav.checkFilter('ga:visits>10;ga:country==Canada'); //returns true

ga-validator's People

Contributors

curtisblackwell avatar fthobe avatar tshaddix avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ga-validator's Issues

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.