Skip to content

Latest commit

 

History

History
117 lines (82 loc) · 2.42 KB

.README.md

File metadata and controls

117 lines (82 loc) · 2.42 KB

Multicat

${badge('npm')} ${badge('npm-license')}

A Unified analytics API

${badge('nodei')}

Providers:

  • Google Analytics
  • Google Remarketing Tag
  • Mixpanel
  • Facebook pixel
  • Twitter pixel
  • Pinterest pixel
  • Reddit pixel
  • LinkedIn Insight Tag
  • Hotjar
  • REST endpoint

Features:

  • Unified API
  • Landen.io Integration
  • React context provider

ES6

Install

npm install --save ${pkg.name}

or

yarn add ${pkg.name}

Usage

import Multicat from '${pkg.name}'

const multicatConfig = {
  google_analytics: <GOOGLE_ANALYTICS_ID>,
  google_remarketing: <GOOGLE_REMARKETING_TAG>,
  mixpanel: <MIXPANEL_ID>,
  hotjar: <HOTJAR_ID>,
  facebook_pixel: <FACEBOOK_PIXEL_ID>,
  twitter_pixel: <TWITTER_ID>,
  pinterest_pixel: <PINTEREST_ID>,
  reddit_pixel_q: <REDDIT_PIXEL_Q>,
  reddit_pixel_s: <REDDIT_PIXEL_S>,
  linkedin: <LINKEDIN_PARTNER_ID>,
  rest_endpoint: <REST_ENDPOINT>,
}

const multicat = new Multicat(multicatConfig)

multicat.event(`MY_EVENT`, {me: 'ta', da: 'ta'})
multicat.view('/thank-you.html')

Vanilla JavaScript

<!-- Include the script -->
<script src='https://unpkg.com/${pkg.name}@${pkg.version}/build/web.js'></script>

<script>
  // Specify your analytics IDs
  var multicatConfig = {
    google_analytics: 'GOOGLE_ANALYTICS_ID',
    mixpanel: 'MIXPANEL_ID',
    facebook_pixel: 'FACEBOOK_PIXEL_ID'
  }

  // Initialize Multicat
  var multicat = new Multicat(multicatConfig);

  // Run any page view
  multicat.view('/thank-you.html');

  // Attach listeners to things
  var button = document.getElementById('submitButton');
  button.addEventListener('click', function(ev) {
    // Broadcast custom events in response to user actions
    multicat.event(`MY_EVENT`, {me: 'ta', da: 'ta'});
  });
</script>

Landen.io

Drop in version for Landen: packages/multicat-landen

React

Context provider for React: packages/multicat-react

API & Logging

See the packages/multicat/README.md for more info.

License & Contributors

${pkg.license} © ${pkg.author.name}


You can find more tools like this on the Cofab website.