如何设置GA4
步骤1:打开Pixel设置
步骤2:添加自定义Pixel
在Customer events中点击Add custom pixel按钮
步骤3:命名Pixel
在Pixel name字段输入:
Omega Trakpilot Custom Script
然后点击Add pixel继续
步骤4:设置客户隐私
根据Shopify要求配置数据隐私设置,了解更多
- Customer privacy - Permission:选择Not required
- Customer privacy - Data sale:选择Data Collected does not qualify as data sale
点击Save继续
步骤5:清除默认代码
按Ctrl+A全选并删除编辑器中的默认代码
步骤6:粘贴自定义代码
将您的JavaScript代码粘贴到编辑器中(建议使用以下代码):
function injectScript(t){const e=document.createElement("script");e.type="text/javascript",e.src=t,e.onload=function(){try{otGGTrackEvent(analytics,browser)}catch(t){console.error("Error loading script:",t)}};const r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(e,r)}injectScript("https://trakpilot.com/customer-events/index.js?v="+(new Date).getTime());
完成后点击Save
步骤7:激活Pixel
点击Connect完成连接
✅ 完成!
您的自定义Pixel现已安装完毕,可开始使用Omega Trakpilot脚本追踪事件。
更新于: 09/07/2025
谢谢!