react-tiktok-helper
v0.1.3
Published
React tiktok helper
Downloads
244
Maintainers
Readme
React Tiktok Helper
This package contains "Tiktok Pixel" for tiktok ads. Already used in the Next.js project. it has been compailed using Babel.js, so it can run on old browsers.
Install
npm i react-tiktok-helper --saveExample
I recommend that tiktok.config() is called in the react context or it should be in the _app.js file.
import React, { useEffect } from 'react';
import tiktok from 'react-tiktok-helper';
function App() {
function handleClick(){
tiktok.event('Purchase', {
content_id: '123',
content_type: 'product',
price: 666,
quantity: 1,
currency: 'IDR',
});
}
useEffect(() => {
tiktok.config(`${YOUR_EVENT_ID}`);
}, []);
return (
// .../
);
}
