英文:
How to add snapchat Pixel on Next.js?
问题
你想知道如何在Next.js上使用Snapchat像素,是不是和添加Facebook像素的方式相同?
英文:
I'm wondering How can I do to use snapchat pixel on a next.js
is it the same way as add facebook pixel?
答案1
得分: 0
要集成 Snapchat 像素,
-
另一种方法是使用包next-snapchat-pixel。
# 安装包
npm i next-snapchat-pixel
然后像这样使用它
import SnapPixel from 'next-snapchat-pixel';
SnapPixel.init('YOUR_PIXEL_ID');
SnapPixel.track('TRACK_TYPE');
// 对于带有数据的跟踪(价格、货币等)
SnapPixel.trackWithData('TRACK_TYPE', {DATA})
英文:
To integrate snapchat pixel,
-
you could either follow the official documentation and copy paste the generated code within your app directly (using
next/head
). -
An alternate way would be to use the package next-snapchat-pixel.
# install the package
npm i next-snapchat-pixel
Then use it like this
import SnapPixel from 'next-snapchat-pixel';
SnapPixel.init('YOUR_PIXEL_ID');
SnapPixel.track('TRACK_TYPE');
// For tracking with data (price,currency,...)
SnapPixel.trackWithData('TRACK_TYPE', {DATA})
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论