> For the complete documentation index, see [llms.txt](https://trakpilot.gitbook.io/trakpilot-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trakpilot.gitbook.io/trakpilot-docs/google-analytics-4/how-to-setup-ga4.md).

# How to setup GA4

Step 1: Open Pixel Setting

<figure><img src="/files/52Imk5M6rqlBOJ50c2do" alt=""><figcaption></figcaption></figure>

Step 2: In Customer events, click button **Add custom pixel**

<figure><img src="/files/VSxCT00N6xk2n5OCQGcL" alt=""><figcaption></figcaption></figure>

Step 3:

In the **Pixel name** field, enter: **Omega Trakpilot Custom Script**

Then click **Add pixel** to proceed

<figure><img src="/files/7NGYZwnrDSNbRkKRxyiJ" alt=""><figcaption></figcaption></figure>

Step 4: Setup Customer privacy

Shopify asks you to describe how this pixel handles customer data, [read more](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage#customer-privacy)

* Customer privacy - Permission: select **Not required**
* Customer privacy - Data sale: select **Data Collected does not qualify as data sale**

Then click **Save** to proceed

<figure><img src="/files/zUIQsBYKpREJ4WVYsViY" alt=""><figcaption></figcaption></figure>

Step 5: Press Ctrl + A and remove the suggested code&#x20;

<figure><img src="/files/fioOYP05zCqqlL2MVTQ7" alt=""><figcaption></figcaption></figure>

Step 6:

Paste your custom JavaScript code (previously copied) into the code editor section of your custom pixel.

Script code like this:

```
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());
```

* Once done, click **Save**

<figure><img src="/files/qSLKM9NYiMJCQabuEVaY" alt=""><figcaption></figcaption></figure>

Step 7: Click Connect to activate the pixel.

<figure><img src="/files/hAdM50Wmv2sQxtf0RDdE" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/B08vKN1w0oZBfChHDla8" alt=""><figcaption></figcaption></figure>

✅ **That’s it!**\
Your custom pixel is now installed and ready to track events using the Omega Trakpilot script.
