Skip to content
A wrapper and configuration tool to seamlessly handle multiple Google Analytics accounts, complete with custom metrics and dimensions.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
dist
src
.gitignore
LICENSE
bower.json
package.json
readme.md

readme.md

Gauntlet.js

A wrapper and configuration tool to seamlessly handle multiple Google Analytics accounts.

It's small enough (~2kb) to use without worry. It can even be used just for a single GA account at a time to simply clean and modularize your code.

Is it any good?

You bet.

Installation

bower install gauntletjs

Usage

It's as easy as adding one javascript file to your document, and defining the Google Analytics profiles to which you will send data.

<script type="text/javascript" 
  src="/gauntlet.min.js">
</script>
<script type="text/javascript">
  if (Gauntlet) {
    // Let's list out our accounts
    var myGauntlet = new Gauntlet({
      accounts:[
        {
          profile: 'UA-XXXXX-XX',
          domain: 'auto',
          name: 'ProductAccount'
        },
        {
          profile: 'UA-XXXXX-XX',
          domain: 'example.com',
          name: 'BrandAccount'
        }
      ],
      custom: {
        'dimension1': 'custom dimension data',
        'metric2': 'custom metric data'
      },
      displayFeatures: true
    });
  }
</script>

Alternatively, you can download the Gauntlet source and bundle/minify it into your own source code. It plays nicely with your other source files.

Author

Joshua Beckman

License

Licensed under MIT.

Something went wrong with that request. Please try again.