> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.omegatheme.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# 如何设置GA4

### 步骤1：打开Pixel设置
![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/image_r0stxj.png)

### 步骤2：添加自定义Pixel
在Customer events中点击**Add custom pixel**按钮  
![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/image_1yc0wm4.png)

### 步骤3：命名Pixel
在**Pixel name**字段输入：  
**Omega Trakpilot Custom Script**  
然后点击**Add pixel**继续  
![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/image_193jfo0.png)

### 步骤4：设置客户隐私
根据Shopify要求配置数据隐私设置，[了解更多](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage#customer-privacy)  
* Customer privacy - Permission：选择**Not required**  
* Customer privacy - Data sale：选择**Data Collected does not qualify as data sale**  
点击**Save**继续  
![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/image_126oot.png)

### 步骤5：清除默认代码
按Ctrl+A全选并删除编辑器中的默认代码  
![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/image_6xdxqi.png)

### 步骤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**  
![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/image_ukj3we.png)

### 步骤7：激活Pixel
点击**Connect**完成连接  
![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/image_15vc3t2.png) 
![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/image_1gsub9j.png)

✅ **完成！**  
您的自定义Pixel现已安装完毕，可开始使用Omega Trakpilot脚本追踪事件。
