https://github.com/hexlet/analytics-plugin-pipedream
https://github.com/hexlet/analytics-plugin-pipedream
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hexlet/analytics-plugin-pipedream
- Owner: Hexlet
- Created: 2021-05-31T12:14:40.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-30T19:52:45.000Z (almost 2 years ago)
- Last Synced: 2025-02-16T02:47:10.143Z (over 1 year ago)
- Language: JavaScript
- Size: 74.2 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# analytics-pipedream
This library exports the Pipedream plugin for the [analytics](https://www.npmjs.com/package/analytics) package.
## Installation
```
npm install analytics @hexlet/analytics-plugin-pipedream
```
## How to use
```javascript
import Analytics from 'analytics';
import pipedreamPlugin from '@hexlet/analytics-plugin-pipedream';
const pipedreamConfig = {
event_one: 'https://triggerUniquePathOne.m.pipedream.net', // this must be pipedream trigger url
event_two: 'https://triggerUniquePathTwo.m.pipedream.net',
};
const analytics = Analytics({
app: 'my-app',
plugins: [
pipedreamPlugin({
workflows: pipedreamConfig,
}),
],
});
// track an event
analytics.track('signed_up', { email: 'user@example.com' });
```
In browser
```html
var Analytics = _analytics.init({
app: 'my-app',
plugins: [
PipedreamPlugin({
workflows: pipedreamConfig,
}),
],
});
Analytics.track('signed_up', { email: 'user@example.com' }); // track an event
```