1.6.0 • Published 7 years ago

@cnbritain/merlin-frontend-gatracker-js v1.6.0

Weekly downloads
8
License
ISC
Repository
github
Last release
7 years ago

merlin-frontend-gatracker-js

Google analytics wrapper

JS Documentation

GATracker

Kind: global class

new GATracker(id, _config)

ParamTypeDescription
idStringThe GA unique id
_configObject

gaTracker.send(hitType, config)

Fires a ga send call

Kind: instance method of GATracker
Access: public

ParamTypeDescription
hitTypeString
configObjectData to send along with the call

gaTracker.set(fieldName, value)

Fires a ga set call to set information

Kind: instance method of GATracker
Access: public

ParamTypeDescription
fieldNameString/ObjectEither a key or an object with data
valueString/Number

GATracker.TRACKERS : Array

List of trackers that have been created

Kind: static property of GATracker

GATracker.INDEX_BY_DIMENSION : Object

Lookup table of dimension index by dimension label

Kind: static property of GATracker

GATracker.DIMENSION_BY_INDEX : Object

Lookup table of dimension labels by dimension index

Kind: static property of GATracker

GATracker.TRACKING_BRAND_ID : String

The GA tracking id of the site. This will be updated in the page template.

Kind: static property of GATracker

GATracker.TRACKING_CONDE_ID : String

The GA tracking id for CondeNast

Kind: static property of GATracker

GATracker.COMSCORE_PUBLISHED_ID : Number

Comscore id

Kind: static property of GATracker

GATracker.RE_SITE : RegExp

RegEx for brand site This isn't set because each brand should specify in the core

Kind: static property of GATracker

GATracker.REFERRERS : Object

List of referrer types

Kind: static constant of GATracker

GATracker.SEND_HITTYPES : Object

List of ga send hit types

Kind: static constant of GATracker

GATracker.SendAll(hitType, config)

Calls send on all the trackers

Kind: static method of GATracker

ParamType
hitTypeString
configObject

GATracker.SetAll(fieldName, value)

Calls set on all the trackers

Kind: static method of GATracker

ParamType
fieldNameString/Object
valueString/Number

GATracker.getDimensionByIndex(index) ⇒ String

Gets the dimension label by dimension index

Kind: static method of GATracker
Returns: String - The dimension label

ParamType
indexString

GATracker.getIndexByDimension(dimension) ⇒ String

Gets the dimension index by dimension label

Kind: static method of GATracker
Returns: String - The dimension index

ParamType
dimensionString

Prerequisites:

  • Node.jsbrew install node
  • Grunt - npm install -g grunt-cli
  • Other prereqs? Python? Virtualenv?

Demo:

Install dependencies:

npm install

Build the things:

npm run sass
npm run js
npm run docs

Hint your JS

npm run jshint

Python the pythons:

npm run demo-install

Start the demo server:

python demo.py
1.6.0

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago