convrt-tracker
v1.0.3
Published
Convert Tracker module
Downloads
2
Readme
This package is for track the user event in Convrt
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-tracker
Then in your code:
import { ConvrtPixel } from 'convrt-tracker';
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-tracker';
...
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-tracker';
...
...
onMounted(() => {
...
new ConvrtPixel('<client_id>').PixelInit();
...
});