npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tiktok-pixel

v2.0.3

Published

Tiktok Pixel Kit for React

Downloads

17,564

Readme

React Tiktok Pixel

npm

React JS wrapper for Tiktok's Pixel

Install

npm install --save tiktok-pixel

or

yarn add tiktok-pixel

How to use

import TiktokPixel from 'tiktok-pixel';

const advancedMatching = {
  email: '[email protected]',
  phone_number: '0123456789',
}; // optional, more info: https://ads.tiktok.com/help/article?aid=10007891

const options = {
  debug: false, // enable logs
};

TiktokPixel.init('yourPixelIdGoesHere', advancedMatching, options);

TiktokPixel.pageView(); // For tracking page view
TiktokPixel.track(event, data); // For tracking default events. More info about standard events: https://ads.tiktok.com/help/article?aid=10028

const trackingOptions = {
  event_id: 'some ID', // optional
};

TiktokPixel.track(event, data, trackingOptions);

Running the example

yarn build
cd example
yarn start

Event Types

| Event type | Recommended parameters | | -------------------- | ---------------------------------------------------------------- | | AddPaymentInfo | | | AddToCart | content_type, quantity, description, content_id, currency, value | | AddToWishlist | | | ClickButton | | | CompletePayment | content_type, quantity, description, content_id, currency, value | | CompleteRegistration | | | Contact | | | Download | | | InitiateCheckout | | | PlaceAnOrder | content_type, quantity, description, content_id, currency, value | | Search | | | SubmitForm | | | Subscribe | | | ViewContent | content_type, quantity, description, content_id, currency, value |

Parameters

| Parameter | Description | Value type | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | content_type | The content_type object property's value must be set to either product, or product_group, depending on how you will configure your data feed when you set up your product catalog. If you will be tracking events associated with individual products, set the value to product. If you are tracking events associated with product groups, set it to product_group instead. | Must be either product or product_group. | | content_id or contents | Use contents when you have multiple content IDs. If you use contents in your parameter, you must also include the following in a sub-object: the product id or ids, and the quantity (number of items added to cart or purchased). | Must be a string if using 'content_id.' Must be an array of objects (content parameter, id sub-object and quantity sub-object) if using 'contents' | | content_category | Category of the page/product | string | | content_name | Name of the page/product | | string | | currency | SO 4217 code. List of currencies currently supported: AED, ARS, AUD, BDT, BHD, BIF, BOB, BRL, CAD, CHF, CLP, CNY, COP, CRC, CZK, DKK, DZD, EGP, EUR, GBP, GTQ, HKD, HNL, HUF, IDR, ILS, INR, ISK, JPY, KES, KHR, KRW, KWD, KZT, MAD, MOP, MXN, MYR, NGN, NIO, NOK, NZD, OMR, PEN, PHP, PHP, PKR, PLN, PYG, QAR, RON, RUB, SAR, SEK, SGD, THB, TRY, TWD, UAH, USD, VES, VND, ZAR | enum(string) | | value | Value of the order or items sold. Note: Price is the price for a single item, and value is the total price of the order. For example, if you have two items each sold for $10, the price parameter would pass 10 and the value parameter would pass 20. | number | | price | The price of the item. Note: Price is the price for a single item, and value is the total price of the order. For example, if you have two items each sold for $10, the price parameter would pass 10 and the value parameter would pass 20. | number | | quantity | The number of item(s). | number | | query | The text string that was input by a user. For instance, if a person searches for a product on your website, you can forward the keyword being searched. If a person enters a coupon code at check out, you can forward the code. | string | | description | Description of the item or page. | string | | status | Status of an order, item, or service. Note: Depending on your use of 'status', Events API may be required in order to share status changes to TikTok. | string |

Follow me on LinkedIn: @ertemishakk

Checkout this article for detailed explanation: React JS Wrapper for TikTok

Read about me : ishakertem.com