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

# Publisher embed guide

> This guide is for developers who put creator links on a website, in an app, or in any other surface a creator controls.

This guide is for developers who put creator links on a website, in an app, or in any other surface a creator controls. It explains where a link comes from, what it does when clicked, and how to place it without breaking tracking.

> [!WARNING]
>
> **There is no JavaScript ad widget any more.** Earlier versions of the platform shipped an embeddable ad widget, publisher embed tokens (`uam_pub_embed_...`), `UAM.init()`, `UAM.recordMovement()` and `/track/*` endpoints. All of these were retired along with the separate ad service. If you have that snippet on a page, remove it; it no longer loads. Today a creator integrates with **links**.

## What a creator link is

Every creator in a campaign has one personal link per campaign. It points at the platform's public redirect:

```text theme={null}
https://<platform host>/go/<17-character code>
```

The code is an opaque, case-insensitive share code with a built-in check character, so most typos are rejected rather than credited to someone else. It does not reveal the campaign id or the creator's account. An older long form, `/go/<campaignId>/<creator address>`, still resolves for links shared in the past, but new links use the short form.

When a shopper opens the link, the platform:

1. records a click and mints a click id (`clk_<uuid>`);
2. optionally allocates a single-use discount code for that click, if the brand enabled codes for the campaign;
3. responds with a `302` redirect to the brand's product page, with tracking parameters added:

```text theme={null}
https://brand-store.example/products/widget
  ?uam_click=clk_550e8400-e29b-41d4-a716-446655440000
  &utm_source=uam&utm_medium=affiliate
  &utm_term=clk_550e8400-e29b-41d4-a716-446655440000
```

On Shopify stores, the brand's theme app embed then stores the click in the shopper's cart so it survives to checkout. Nothing else is needed on the creator's side. How the click is later matched to an order is covered in [Attribution engine](https://docs.higherfrequency.io/developers/attribution-engine.md).

## Getting a creator's link

Creators copy their link from the Freeq Growth Network app. To fetch it programmatically on the creator's behalf, call the application API with the creator's Clerk session token:

```http theme={null}
GET /api/campaigns/{campaignId}/my-publisher/share-link
Authorization: Bearer <creator session token>
```

```json theme={null}
{
  "shareLink": "https://<platform host>/go/<code>",
  "campaignId": "campaign_550e8400-e29b-41d4-a716-446655440000",
  "publisherId": "9b4c2d8e-1234-5678-9abc-def012345678",
  "publisherWalletAddress": "0x1234567890abcdef1234567890abcdef12345678",
  "campaignTitle": "Spring launch",
  "destinationUrl": "https://brand-store.example/products/widget"
}
```

Use `shareLink` exactly as returned. `destinationUrl` is for display ("you will be sending shoppers to..."); never link to it directly, because a direct link records no click and earns nothing. The campaign's brand can fetch a member creator's link with `GET /api/campaigns/{campaignId}/publishers/{publisherId}/share-link`. Links are issued only while the campaign is accepting traffic (not in draft, not ended).

Partners that provision creators server to server receive the share link in the provisioning response instead. See [Commerce providers](https://docs.higherfrequency.io/developers/commerce-providers.md#partner-marketplace-partner-wire).

## Placing links

A creator link is an ordinary URL. Put it in a normal anchor:

```html theme={null}
<a href="https://<platform host>/go/<code>" rel="sponsored noopener" target="_blank">
  Shop the widget
</a>
```

Rules that keep tracking intact:

* **Use the link unmodified.** Do not rebuild the destination URL yourself, and do not strip or rewrite query parameters on the way to the store.
* **Let redirects run.** If you route clicks through your own shortener or click tracker, it must follow through to the creator link with a normal redirect, and the platform's `302` must reach the shopper's browser with its query string intact.
* **Do not prefetch.** Each request to the link records a click. Link checkers, prefetching or server-side "preview" fetches create clicks that never reach a shopper.
* **Do not publish the discount code.** Codes shaped `UAM-XXXX-XXXX-XXXX` are minted per click and expire after a short time. They are applied automatically through the link. Sharing one by hand ties every buyer to one old click.
* **Disclose.** Label affiliate links as required where you publish. `rel="sponsored"` is the conventional marker for search engines.

Other query parameters on the `/go` link are ignored, with one exception below.

### Landing on a specific page

Some partner stores let a link land on a page other than the campaign default:

```text theme={null}
https://<platform host>/go/<code>?to=/<allowed-prefix>/spring-collection
```

`to` must be a relative path on the store's own domain, inside the store's allowlist of path prefixes. Anything else (absolute URLs, other domains, encoded characters, query strings or fragments in `to`) is ignored and the shopper lands on the campaign default. The click is recorded either way.

### In mobile apps

Open the link in the system browser or an in-app browser so the redirect and the store's cart script run normally. Do not resolve the redirect in your app and hand the shopper only the final URL; that works once but loses the per-click discount when codes are in use.

## Checking a link

You can inspect a link without a browser:

```bash theme={null}
curl -s -o /dev/null -D - "https://<platform host>/go/<code>" | grep -i '^location'
```

The `Location` header should point at the brand's page with `uam_click=clk_...` in the query string, or at the store's discount URL that redirects there. Remember this records a click.

## Troubleshooting

| Symptom | Likely cause | What to do |
| - | - | - |
| `404 Unknown share code` | Code mistyped, truncated, or the campaign or creator link no longer exists | Copy the link again from the app or the API. |
| Store page opens without `uam_click` | Something between the link and the store rewrote the URL | Remove the intermediate redirect or make it pass the query string through. |
| URL ends with `uam_coupon=unavailable` | The brand's code pool or budget is used up, or the campaign has ended | The click still counts. Tell the brand if this persists. |
| A sale was not credited | Usually a newer click from another creator, a product outside the campaign, or a returning customer | Check the order's reason code; see [Attribution engine](https://docs.higherfrequency.io/developers/attribution-engine.md#8-order-outcomes-and-reasons). |
| Snippet with `UAM.init` does nothing | The retired widget | Replace it with plain links. |


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