> 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="https://2691490957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGk04Mo6U0JgWXlHs7YYY%2Fuploads%2FcK5ZR3437nU4ShgWqe1N%2Fimage.png?alt=media&amp;token=1d56759d-aac9-4eae-822a-d17f69b3fba5" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://2691490957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGk04Mo6U0JgWXlHs7YYY%2Fuploads%2FprD9fpHrUmIHGIFwtjlj%2Fimage.png?alt=media&amp;token=01129648-5f32-49c5-9b03-c32b4b92cc96" 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="https://2691490957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGk04Mo6U0JgWXlHs7YYY%2Fuploads%2F93xB6RTN49wtcVEtx8vS%2Fimage.png?alt=media&amp;token=f011495b-0fc5-44d5-9654-dc82f2bf0706" 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="https://2691490957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGk04Mo6U0JgWXlHs7YYY%2Fuploads%2FySbss8G1Ar76NPHOwkuC%2Fimage.png?alt=media&amp;token=63a40323-db96-4a15-8f5f-76f0020dc667" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://2691490957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGk04Mo6U0JgWXlHs7YYY%2Fuploads%2FsfSFEl1rbLnkGeduDCFc%2Fimage.png?alt=media&amp;token=634961f6-41da-4e6f-b17a-21b3b84d2e15" 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="https://2691490957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGk04Mo6U0JgWXlHs7YYY%2Fuploads%2FoRtNUcGgE6OFhkCwHpG3%2Fimage.png?alt=media&amp;token=7490e66b-6e55-4f6b-ae1c-43e45b673fc8" alt=""><figcaption></figcaption></figure>

Step 7: Click Connect to activate the pixel.

<figure><img src="https://2691490957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGk04Mo6U0JgWXlHs7YYY%2Fuploads%2FwAhsv2MMLOFpWXM6Wzby%2Fimage.png?alt=media&amp;token=2ab8e611-67d2-4821-850f-e9f1883a2632" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2691490957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGk04Mo6U0JgWXlHs7YYY%2Fuploads%2Fv4NkA56r3rDcx38bXHDk%2Fimage.png?alt=media&amp;token=421e7c32-28ca-4255-8457-6db6bb4aa9bb" alt=""><figcaption></figcaption></figure>

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