Skip to content

Commit

Permalink
Internal analytic support (infermedica#1)
Browse files Browse the repository at this point in the history
* config eslint

* config gitignore

* possible to limit used modules per event

* update Readme

* infermedicaAnalytics module skeleton

* infermedicaAnalytics trackEvent has common properties

* support dor Firebase Anonymous Authentication

* axios and Bearer token from Firebase

* event can be disabled

* supported properties property for infermedicaAnalytics

* docs updated

* update Infermedica Analytics module

* possible to setup supported properties

* Support for allow and disallow event properties

* firebase user id in infermedica analytic user data

* event_details will be always publish

* bump version to 0.2.0

* add fallback for infermedica analytics custom baseURL

* prevent to publish event without event_details

* rename event_objects to event_object

* header has infer-application-id

* SC-1224: request to the analytics be signed with a token

* SC-1225: Support topice configuration per event

* airbnb-base eslint config

* lint files

* infermedicaAnalytics dependencies in peerDependencies

* use dynamic import for infermedicaAnalytics dependencies

* use enum for names

* formatter:off

* amplitude module filtered undefined and null properties

* no disable props

* clean eventQueue after use it

* axios, bowser and firebase as dependencies

* update Readme for dependencies

* use production endpoint as default

* optimized filterProperties function

* use Axios.post serialize to JSON

Co-authored-by: Przemysław Spaczek <[email protected]>
  • Loading branch information
pspaczek and pspaczek authored Nov 5, 2021
1 parent 2711839 commit 095e8fb
Show file tree
Hide file tree
Showing 6 changed files with 2,587 additions and 41 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DS_Store
node_modules

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,21 @@ new webpack.DefinePlugin({
},
amplitude: {
isEnabled: true,
key: '<your-key>'
key: '<your-key>',
allowProprties: [], // optional
disallowProperties: ['application', 'user', 'section', 'event_details'], // optional
},
infermedicaAnalytics: {
isEnabled: true,
topic: '<your-topic>',
environment: process.env.NODE_ENV,
firebaseConfig: {
apiKey: '<your-firebase-api-key>',
authDomain: '<your-firebase-auth-domain>',
appId: '<your-firebase-app-id>',
},
allowProperties: ['application', 'user', 'section', 'event_details'], // optional
disallowProperties: [], // optional
},
})
})
Expand Down Expand Up @@ -82,6 +96,14 @@ Analytics.trackEvent('Event name', {
});
```

You can use the event for all modules or decide with modules should be used for this event, e.g.:

```javascript
Analytics.trackEvent('Event name', {
user_rating: 5
}, ['aplitude', 'googleTagManager'])
```

### Conversion tracking

To track events, use:
Expand Down Expand Up @@ -146,6 +168,7 @@ Currently the following providers are supported:
* Google Analytics
* Google Tag Manager (Analytics & AdWords)
* Amplitude
* Infermedica Analytic

Other analytics tools are easy to integrate with this module and we might add their support in the future.

Expand Down
Loading

0 comments on commit 095e8fb

Please sign in to comment.