multicat
v0.0.18
Published
Unified analytics API
Downloads
11
Readme
Multicat
A Unified analytics API
See Main README.md for Features, Installation & Usage instructions.
API
constructor(options: Object)
Set the following keys on the options object, to activate corresponding modules: google_analytics, google_remarketing, mixpanel, hotjar, facebook_pixel, twitter_pixel, pinterest_pixel, reddit_pixel_q, reddit_pixel_s.
view(pathname: String)
Trigger a Page View event in GA, and a custom PageView
event elsewhere. The pathname is the URL reported.
Examples:
multicat.view('/thank_you.html')
multicat.view() // will infer pathname from window.location
event(action: String, properties: Object)
Trigger a custom event specified by action
(i.e.: 'ConversionClick'). Add any metadata you wish to the properties hash.
Example:
multicat.event('ConversionClick', { buttonColor: 'orange' })
Google Analytics:
If you wish to use the Google Analytics events API effectively, keep in mind that Multicat uses the specified event action
for the Google Analytics event action
. You should provide at least the category
property, as well as label
, or any other valid Google Analytics event properties.
Example:
multicat.event('ToolDemoClick', { category: 'DevTools', label: 'Multicat' })
This type of event metadata structure will enable you to effectively use segmentation in both Mixpanel & Google Analytics, as well as create custom audiences in Facebook.
Linked In:
Along with URL based conversion tracking, which you can set up in the Conversion wizard in LinkedIn Ads, you can also track conversion with event-specific pixels. Use the conversionId
generated by LinkedIn as the event action
, if you wish to track conversions correctly.
Logging
The library will log things to the console when in development (process.env.NODE_ENV === 'development'
). You can also turn on logging by setting window.MULTICAT_LOGGING
to true
.
License & Contributors
MIT © Cofab