0

Chrome Extension [Deprecated]

Official support from Segment for this plugin is deprecated. The current version of this plugin should be free of bugs but any existing and future development will be paused for the time being. We recommend exploring and using third party alternatives.

We are currently looking for community maintainers!  If you’re interested in maintaining or contributing to any of our plugins or guides, we'll gladly send some Segment swag your way in return for any merged PRs. Don't forget to give us a heads up via our contact form when you submit a PR.   


You can easily load our browserify’d analytics-node package into a Chrome Extension and send your analytics data to any of our server-side integrations.

This allows you to collect information about your users, like how they interact with and use your extension.

Getting Started

1) Add this file to your Chrome extension source.

2) Setup the library with your write key:

var analytics = new Analytics('YOUR_WRITE_KEY');

That’s it, you’re done! You can now start identifying users and record their actions as they use your extension!

Now just turn on any of our integrations in Segment on your integrations page and we’ll start sending your data to them for you!

Methods

Here are a few examples of methods you might want to fire in your extension:

analytics.identify({
  version: chrome.app.getDetails().version,
  languages: window.navigator.languages
});
analytics.track('Clicked Icon', {
  start: true,
  stop: false,
  background: true
});

Example

Check out daydream, a chrome extension we wrote that uses analytics-node to track user events.