> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MGID

> Send storefront events to MGID with Upstack Data through the MGID pixel in the visitor's browser, server-side postbacks, or both.

> [!NOTE]
>
> **Data direction:** This is a **destination** — Upstack sends event and conversion data **out** to this platform via server-side APIs.

## What does the MGID destination do?

Upstack sends your storefront events to MGID, including product views, carts, checkouts and purchases. MGID uses them to measure and optimize your MGID native ad campaigns.

## How does Upstack send events to MGID?

You choose in the destination's **Tracking Method** setting:

| Tracking Method | What Upstack does | What you need |
| - | - | - |
| **Browser + Server** (default) | Loads the MGID pixel on your store and also sends checkouts and purchases to MGID as postbacks from Upstack's servers | Client ID |
| **Server** | Sends postbacks only. The MGID pixel doesn't load on your store. | Client ID |
| **Browser** | Loads the MGID pixel on your store only | Client ID |

The MGID pixel sends events for every visitor. Postbacks go only for visitors who came from an MGID ad.

## Which purchase goal should my campaign optimize on?

`upstackpurchase`. It comes from the postback, so it includes purchases the MGID pixel missed, for example when an ad blocker stopped it. With **Browser + Server**, each order reaches MGID as both `purchase` and `upstackpurchase`, so optimize each campaign on one of them.

## Setup guides

> [card] [Onboarding guide](https://docs.upstackdata.com/destinations/catalog/mgid/complete-how-to-guide-for-onboarding-mgid-in-upstack-data.md)
>
> Connect MGID to Upstack Data from start to finish.

> [card] [Configure destination](https://docs.upstackdata.com/destinations/catalog/mgid/how-to-configure-mgid-destination-in-upstack-data.md)
>
> Pick a Tracking Method and enter your Client ID.

> [card] [Find Client ID](https://docs.upstackdata.com/destinations/catalog/mgid/how-to-find-mgid-client-id.md)
>
> Find your Client ID in your MGID postback link.

> [card] [Create goals](https://docs.upstackdata.com/destinations/catalog/mgid/how-to-create-mgid-goals.md)
>
> Create the pixel and postback goals in MGID Ads.

## Which events does Upstack send to MGID?

| Upstack event | Pixel goal | Postback goal |
| - | - | - |
| `page_view` | `page_view` | Not sent |
| `view_content` | `product_view` | Not sent |
| `view_category` | `collection_view` | Not sent |
| `search` | `search` | Not sent |
| `add_to_cart` | `add_to_cart` | Not sent |
| `view_cart` | `cart_view` | Not sent |
| `initiate_checkout` | `initiate_checkout` | `upstackcheckout` |
| `purchase` | `purchase` | `upstackpurchase` |
| `lead` | `lead` | Not sent |
| `sign_up` | `sign_up` | Not sent |

To send `lead`, `sign_up` or another event as a postback, add a custom trigger. See **Can I send a postback under my own goal name?** below.

## Questions

> [accordion] Can I send a postback under my own goal name?
>
> Yes. A custom trigger sends an extra postback under your goal name. Upstack still sends `upstackcheckout` and `upstackpurchase`.
>
> 1. In Upstack, open **Destinations** and open your MGID destination.
> 2. Open the **Event Mappings** tab.
> 3. In the **Custom Triggers** section, click **Add Custom Trigger**.
> 4. Set **Base event** to the Upstack event, for example `lead`.
> 5. Set **Destination event name** to the goal name you use in MGID. Use Latin letters and numbers only. Upstack doesn't send a postback whose goal name has any other character, such as `_`.
> 6. Click **Save custom event**.
>
> MGID allows up to three postback goals per campaign. `upstackcheckout` and `upstackpurchase` use two, so you have room for one custom goal.

> [accordion] Do I need to change my MGID ad URLs?
>
> No. MGID adds its click ID to ad clicks as `adclid`, and Upstack reads it on the landing page. If the URL has no `adclid` but has `adclida=<name>`, Upstack reads the click ID from the parameter called `<name>`.

> [accordion] How is revenue sent?
>
> With purchases only. The MGID pixel always sends the purchase value with the `purchase` goal. Postbacks send it with `upstackpurchase` only when **Send Revenue Value** is on.
>
> Upstack sends the value in your store currency and doesn't convert it. MGID reads it in your MGID account currency, so set your MGID account to the same currency as your store.

> [accordion] Do I need to remove my own MGID pixel from my store?
>
> Yes, if your **Tracking Method** is **Browser** or **Browser + Server**. Upstack loads the MGID pixel for you. If your theme, Google Tag Manager or a custom HTML block also loads it or sends goals to it, MGID counts those goals twice.

> [accordion] Can I connect two MGID destinations to one store?
>
> Don't. With two MGID destinations on the same store, Upstack loads only the first one's MGID pixel, and sends every postback for both, so each checkout and purchase reaches MGID twice.

> [accordion] How do I check that events are reaching MGID?
>
> See [How do I check the MGID destination is working?](https://docs.upstackdata.com/destinations/catalog/mgid/how-to-configure-mgid-destination-in-upstack-data.md#how-do-i-check-the-mgid-destination-is-working)

## Related

> [card] [Identity resolution](https://docs.upstackdata.com/pixel/identity-resolution.md)
>
> How Upstack matches anonymous visitors to known customers.

> [card] [Verify events](https://docs.upstackdata.com/quickstart/verify-events.md)
>
> Check that events are firing from your storefront.

> [card] [Events not reaching destination](https://docs.upstackdata.com/troubleshooting/destination-token-expired-or-auth-error.md)
>
> What to check when events aren't arriving at a destination.

> [card] [All destinations](https://docs.upstackdata.com/destinations/catalog.md)
>
> Every destination Upstack can send events to.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.