# Set up Events API

{% hint style="info" %}
This step is required when you add pixel manually. With auto add pixel or create pixel directly within our app, this setup is not necessary. We will auto get the Access token for you.

[**-> See AUTO ADD NEW PIXEL in app**](https://omegatheme-contact.gitbook.io/omega-multiple-tiktok-pixels-1/add-your-tiktok-pixel/auto-add-existing-tiktok-pixel)

[**-> See CREATE NEW PIXEL in app**](https://omegatheme-contact.gitbook.io/omega-multiple-tiktok-pixels-1/add-your-tiktok-pixel/create-new-pixel-directly-in-omega)
{% endhint %}

## Check out this video for detailed instructions:

{% embed url="<https://www.youtube.com/watch?index=5&list=PL74Buw3DNN_amKOGKmPhlzAnxSlRahlne&v=h5HKID6dMzs>" %}

### 1️⃣ Get an access token from TikTok Events Manager

The access token is a key that allows our app to send server events to the TikTok server through Events API. Server events will be stored in your pixel ID and processed the same way as browser events by Tiktok

👉 Go to Settings tab of your pixel

<figure><img src="https://2177492188-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0iV3jZlFz74UvPDH7InX%2Fuploads%2FcFa6X4CoGOqi4UTOUZXs%2Fimage.png?alt=media&#x26;token=dc02021a-f1c6-491b-bfda-6110d8ed8bb6" alt=""><figcaption></figcaption></figure>

👉 Scroll down to the bottom. Click **Generate Access Token**, copy the value&#x20;

<figure><img src="https://2177492188-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0iV3jZlFz74UvPDH7InX%2Fuploads%2FrMKWMoPzsIEE0SRCUWQK%2Fimage.png?alt=media&#x26;token=38687886-f04f-4d6e-b257-c53d4595d5be" alt=""><figcaption></figcaption></figure>

### 2️⃣ Pass the access token to Omega

<figure><img src="https://2177492188-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0iV3jZlFz74UvPDH7InX%2Fuploads%2F2kBWdFIAyvyM0nAuguEn%2Fimage.png?alt=media&#x26;token=e2c4f52c-25ff-49d9-8bc2-f3fb45b81344" alt=""><figcaption></figcaption></figure>

That’s it! Your next task is testing if server events are sent properly.

### Check if your Events API is working well

{% hint style="info" %}
You can either use the Omega Test Tool or the TikTok Event Test Code
{% endhint %}

### Omega Events Test Tool (recommended)

💡 First, copy this line ?otEnableTrackTool=1 and follow the steps

***View content***

<figure><img src="https://2177492188-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0iV3jZlFz74UvPDH7InX%2Fuploads%2FAdeOegvyjOAWUJh2w4Fx%2Fimage.png?alt=media&#x26;token=5f5e326a-df17-4500-9be5-3bc4af9a7ef1" alt=""><figcaption></figcaption></figure>

***Add to cart***

<figure><img src="https://2177492188-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0iV3jZlFz74UvPDH7InX%2Fuploads%2F34DLV0W7KJ8SnPTNGQhZ%2Fimage.png?alt=media&#x26;token=3e2b4ca0-bd74-4821-9516-601c4cfcdf20" alt=""><figcaption></figcaption></figure>

***Initiate Checkout***

<figure><img src="https://2177492188-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0iV3jZlFz74UvPDH7InX%2Fuploads%2Flsp60QZzGSQsbHI0YyVx%2Fimage.png?alt=media&#x26;token=816273eb-4f96-4bbb-a1b7-ab8f90ddfe3d" alt=""><figcaption></figcaption></figure>

***Complete Checkout***

<figure><img src="https://2177492188-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0iV3jZlFz74UvPDH7InX%2Fuploads%2F04leaDzXeb4o9UobCwcf%2Fimage.png?alt=media&#x26;token=bdde807e-9e37-44ef-89c4-84d638188789" alt=""><figcaption></figcaption></figure>

You can also double check in your Event Manager

<figure><img src="https://2177492188-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0iV3jZlFz74UvPDH7InX%2Fuploads%2FZhp0k1bxBP4wmay1ZgUB%2Fimage.png?alt=media&#x26;token=9e2dd027-7a9a-4442-876f-fcd0b2650944" alt=""><figcaption></figcaption></figure>

### TikTok Event Test Code

#### Go to your TikTok Pixel -> Test Events -> Copy the test code

<figure><img src="https://2177492188-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0iV3jZlFz74UvPDH7InX%2Fuploads%2FtS3KrbUpFC6VSFaHCFrl%2FGroup%2084%20(1).png?alt=media&#x26;token=3a1b3ede-bfd3-4757-b125-e26a99be0439" alt=""><figcaption></figcaption></figure>

#### Paste the code to Omega

<figure><img src="https://2177492188-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0iV3jZlFz74UvPDH7InX%2Fuploads%2FC276AYcvTIbTzE1BnyZb%2Fimage.png?alt=media&#x26;token=63f8e68a-51a6-43ae-b6b9-855d0032ac3d" alt=""><figcaption></figcaption></figure>

That's it. You can perform some test actions & go back to the TikTok Test Events tab to see the test events result.

{% hint style="warning" %}
**Important:** You have to remove the test code after testing for the live events to arrive properly
{% endhint %}
