convrt-sdk
v1.0.0
Published
Convert SDK
Downloads
1
Readme
Convrt analytics SDK package for fetching front-end events
1. Using it in Vanillia JS
<script src="https://convrt.io/backend_api/static/scriptv`<script_version>`.js"></script>
<script>
new ConvrtPixel('<client_id>').PixelInit();
</script>
2. Using it as a node module
Install node module
npm i convrt-sdk
Then in your code:
import { ConvrtPixel } from 'convrt-sdk';
And you need to run below method in componentDidMound lifecycle of App.
new ConvrtPixel('<client_id>').PixelInit();
3. Examples
Using Vanillia JS Example
<body>
...
...
<script src="https://convrt.io/backend_api/static/scriptv1.0.2.js"></script>
<script>
new ConvrtPixel('<client_id>').PixelInit();
</script>
</body>
React example
import { useEffect } from 'react';
import { ConvrtPixel } from 'convrt-sdk';
...
function App() {
...
useEffect(() => {
new ConvrtPixel('<client_id>').PixelInit();
}, []);
...
}
If you have multi API calling error, please check this link: https://stackoverflow.com/a/72238236/19871084
Vue example
import { ConvrtPixel } from 'convrt-sdk';
...
...
onMounted(() => {
...
new ConvrtPixel('<client_id>').PixelInit();
...
});