https://github.com/moesif/docusaurus-plugin-moesif
https://github.com/moesif/docusaurus-plugin-moesif
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/moesif/docusaurus-plugin-moesif
- Owner: Moesif
- License: other
- Created: 2020-12-03T00:47:58.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-19T21:56:48.000Z (almost 3 years ago)
- Last Synced: 2025-04-17T03:53:20.958Z (6 months ago)
- Language: JavaScript
- Size: 55.7 KB
- Stars: 0
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Moesif Docusaurus Plugin
A Docusaurus plugin for [Moesif API Analytics](https://www.moesif.com/) built using `moesif-browser-js`.
For full documentation and configuration, see [moesif-browser-js docs](https://www.moesif.com/docs/client-integration/browser-js/)
The SDK automatically collects useful context from a user's device including any marketing attribution, device type, and location information and stores in the user and/or company profile in Moesif. You can add additional customer properties such as user email and company domain via the [identifyUser()](https://www.moesif.com/docs/client-integration/browser-js/#identifying-users) and [identifyCompany()](https://www.moesif.com/docs/client-integration/browser-js/#identifying-companies) methods.
> The below Diagram shows how both `docusaurus-plugin-moesif` and a Moesif [server integration](https://www.moesif.com/docs/server-integration/) to track both web and API traffic made by a customer.

## How to install
1. Install `docusaurus-plugin-moesif`
`npm install --save docusaurus-plugin-moesif`
2. Add plugin to `docusaurus.config.js`
```javascript
module.exports = {
plugins: ['docusaurus-plugin-moesif'],
themeConfig: {
moesif: {
applicationId: 'Your Moesif Application Id',
// Add other Moesif options here.
},
},
};
```3. Test it works
Because the plugin is disabled when `NODE_ENV` is set to development, you'll want to create a production build:
```bash
npm run buildnpm run serve
```## How to use
Any of the Moesif browser APIs are accessible via `window.moesif`.
The plugin tracks page views automatically but we also recommend [identifying the user](https://www.moesif.com/docs/client-integration/browser-js/#identifying-users) like so:```javascript
window.moesif.identifyUser("12345", {
email: "john@acmeinc.com",
firstName: "John",
lastName: "Doe",
title: "Software Engineer",
salesInfo: {
stage: "Customer",
lifetimeValue: 24000,
accountOwner: "mary@contoso.com",
},
});
```## Configuration Options
For full list of configuration options, [see this page](https://www.moesif.com/docs/client-integration/browser-js/#configuration-options).