orgavita-analytic-package
v1.0.2-c
Published
A package to connect nextjs app to orgavita-analytic
Downloads
5
Readme
Orgavita Analytic Package
the purpose of this package is to link react app to orgavita first-party analytic system
Install
Install with npm:
$ npm install --save orgavita-analytic-package
Install with yarn:
$ yarn add orgavita-analytic-package
Usage
Analytic Component
A component to wrap react app which fire event on first open, session start, page change and mouse click
the component catch utm_source and utm_campaign url parameters
import React from 'react'
import Analytic from 'orgavita-analytic-package'
const MyComponent = () => {
return (
<Analytic
project={'AnalyticProjectToken'}
apiUrl={'http://baseUrl.api'}
route={'/myroute/123'}
path={'/myroute/[ObjectId]'}
query={{
'getParameter': 'value'
}}
>
<SomeComponent>
</Analytic>
)
}
export default MyComponent
eventAnalytic function
fire an analytic custom event with or without data
import {eventAnalytic} from 'orgavita-analytic-package'
const optionalData = {
'key': 'anyValue'
}
eventAnalytic('eventName', 'apiUrl', optionalData)