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

# Advertiser quickstart

> Get your ads running on AI platforms in minutes.

## What Gravity does for you

Gravity places your brand inside real conversations on AI platforms — chat apps, coding assistants, AI search. When a conversation is relevant to your product, Gravity generates an ad tuned to that specific conversation. You don't write ad copy.

There are two things you need to set up:

1. **Install the Gravity pixel** on your website so we can track who clicked your ad
2. **Send us your conversions** so we can tell you which ads are actually driving revenue

That's the whole integration. Let's walk through it.

***

## Step 1 — Sign up and create a campaign

1. Go to [app.trygravity.ai/advertiser/signup](https://app.trygravity.ai/advertiser/signup)
2. Enter your email and company name
3. Add a credit card (you can set a billing plan later)

Then create your first campaign: **Dashboard → Campaigns → New**.

| Field            | What to enter                                                                             |
| ---------------- | ----------------------------------------------------------------------------------------- |
| **Name**         | An internal label (users won't see this)                                                  |
| **URL**          | Your landing page — Gravity reads it to understand your product and generate relevant ads |
| **Daily budget** | The most you want to spend per day                                                        |

Hit save — your campaign is live.

***

## Step 2 — Install the pixel on your website

<Warning>
  **This is required.** Without the pixel, Gravity can't track conversions or optimize your campaigns.
</Warning>

Add this snippet to the `<head>` of your website. It needs to be on **every page** and **every subdomain** where a visitor might land or convert.

```html theme={null}
<script>
  !function(w,d,t,u,n,a,m){w['GravityPixelObject']=n;w[n]=w[n]||function(){
  (w[n].q=w[n].q||[]).push(arguments)},w[n].l=1*new Date();a=d.createElement(t),
  m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
  }(window,document,'script','https://code.trygravity.ai/gr-pix.js','gravity');
  gravity('init', 'YOUR_ADVERTISER_ID');
</script>
```

Replace `YOUR_ADVERTISER_ID` with your ID from **Settings → Organization** in the dashboard.

<Tip>
  Put the pixel in your site's root layout or header template so it loads on every page automatically. Don't add it to individual pages one by one — that's error-prone and you'll miss pages.
</Tip>

**Using Shopify?** Skip this — the Shopify integration installs the pixel automatically. See [Step 3](#step-3--set-up-conversion-tracking).

### Verify the pixel is working

1. Open your website in a browser
2. Open DevTools (right-click → Inspect → Network tab)
3. Look for a request to `api.trygravity.ai/track/gr-events`
4. A `200` response means it's working

***

## Step 3 — Set up conversion tracking

The pixel tracks page views. To track actual conversions (purchases, signups, demo requests), you need to send them from your server. This is called the **Conversions API (CAPI)**.

Pick the option that matches your setup:

<CardGroup cols={2}>
  <Card title="Shopify" icon="shopify" href="/advertisers/pixel#shopify">
    One-click connect. Pixel + conversions are automatic — no code needed.
  </Card>

  <Card title="Conversions API" icon="code" href="/advertisers/server-conversions">
    Send conversions from your backend. Works with any platform.
  </Card>

  <Card title="App installs" icon="mobile" href="/advertisers/app-installs">
    Track iOS / Android installs via your backend or MMP postback.
  </Card>

  <Card title="Cal.com" icon="calendar" href="/advertisers/pixel#calcom-bookings">
    Booking webhook for demo / consulting flows.
  </Card>
</CardGroup>

### Quick CAPI example

If you're not on Shopify, here's the gist. Full guide: [Server-side conversions](/advertisers/server-conversions).

**1. On your checkout/thank-you page**, read the pixel's attribution data:

```javascript theme={null}
var capiData = window.gravityPixel.getCAPIData();

// Send it to your backend with the order
fetch('/api/complete-order', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    order_id: 'order-123',
    total: 99.99,
    email: 'customer@example.com',
    gravity: capiData
  })
});
```

**2. On your backend**, forward it to Gravity:

```python theme={null}
gravity_data = request.json.get("gravity", {})

requests.post(
    "https://api.trygravity.ai/gateway/events",
    params={"api_key": "YOUR_API_KEY"},
    json={
        "data": [{
            "event_name": "Purchase",
            "event_time": int(time.time()),
            "event_id": f"order-{order_id}",
            "action_source": "website",
            "event_source_url": gravity_data.get("event_source_url", ""),
            "user_data": {
                **gravity_data.get("user_data", {}),
                "em": [customer_email],
            },
            "custom_data": {
                "value": order_total,
                "currency": "USD",
                "order_id": order_id,
            },
        }],
    },
)
```

That's it. Gravity handles attribution, deduplication, and reporting from here.

***

## Step 4 — Watch it run

**Dashboard → Campaigns** → your campaign. You'll see:

* Impressions, clicks, and spend
* Conversion count and ROAS (once conversions are flowing)
* Top-performing publishers and conversation topics

***

## Optional — Improve attribution accuracy

For even better tracking (especially on Safari and browsers that block third-party cookies), you can route pixel requests through your own domain. It's a simple forwarding rule — no custom code.

See the [first-party proxy setup](/advertisers/pixel#optional--improve-attribution-with-a-first-party-proxy) in the Pixel guide.

***

## Next

<CardGroup cols={2}>
  <Card title="Conversions API" icon="code" href="/advertisers/server-conversions">
    Full CAPI setup guide with Python, Node.js, and cURL examples.
  </Card>

  <Card title="Campaigns" icon="bullhorn" href="/advertisers/campaigns">
    Targeting, bidding, and creative guidelines.
  </Card>
</CardGroup>

Questions? [support@trygravity.ai](mailto:support@trygravity.ai)
