# Trybe

Trybe is an affiliate and influencer marketing attribution platform for e-commerce brands. The EdgeTag Trybe integration covers both browser and server-side event tracking. The browser SDK handles Trybe initialisation, click ID capture, and standard e-commerce events. The server side sends the confirmed purchase to the Trybe Attribution API with the click ID attached for attribution.

|                        |                                                    |
| ---------------------- | -------------------------------------------------- |
| **Channel identifier** | `trybe`                                            |
| **NPM package**        | `@blotoutio/providers-trybe-sdk`                   |
| **Attribution API**    | `POST https://jointrybe.com/attribution/v1/orders` |
| **Consent category**   | Advertising                                        |

### Event Flow

**Browser SDK** — The Trybe pixel is loaded on the storefront (either auto-injected by EdgeTag or pre-installed). The pixel sets `window._trybe.vid` which is the visitor ID used for attribution. The browser SDK fires standard e-commerce events (`ViewContent`, `AddToCart`, `InitiateCheckout`, `Purchase`) by calling the corresponding `window._trybe.track*` methods.

**Server side** — Only the `Purchase` event is sent to the Trybe Attribution API from the edge. The click ID (captured from the `?trybe=` affiliate URL parameter) is attached as the `vid` and is mandatory for attribution. As a fallback, EdgeTag also reads the `ugc_vid_{storeId}` cookie set by the pixel. If no visitor ID is found, the server-side Purchase call is skipped.

### Click ID Capture

When a visitor arrives via a Trybe affiliate link (e.g. `https://yourstore.com?trybe=CLICK_ID`), EdgeTag captures the `trybe` query parameter at the edge and persists it for the session. This click ID is then attached to the server-side Purchase event for attribution.

### Useful Links

* [Trybe Dashboard](https://jointrybe.com)
* [Trybe Attribution API Documentation](https://docs.jointrybe.com)
