Skip to main content

Affise < - > OpenAI Ads

Written by Daria Mamchenkova

OpenAI Ads allows accepting Affise S2S conversions through the OpenAI Conversions API.

OpenAI Ads optimizes traffic based on the conversions it can track. Website pixels may miss conversions confirmed later, such as approved orders, qualified leads, or deposits. Browser tracking can also be affected by cookie restrictions, ad blockers, and privacy settings.

With server-to-server tracking, Affise sends conversions directly to OpenAI Ads. This does not depend on the user’s browser. You also need fewer pixels on your website. Send conversions to Affise once, and Affise forwards them to each platform’s Conversions API, including Meta cAPI, Impact, and OpenAI Ads.

To add a new platform, configure it in Affise. No website changes are needed.

Before you begin

How it works

OpenAI Ads does not accept redirect tracking links as an ad destination, your ad points directly at your own landing page. Affise therefore registers the click from the page itself, using the Affise WebSDK, rather than through a redirect.

The logic is the following:

  1. A user clicks your ad on OpenAI Ads and lands on your page. OpenAI adds its click identifier to the page URL.

  2. The Affise WebSDK on your landing page registers the click and stores OpenAI’s click identifier in Affise’s sub1 parameter.

  3. When the conversion is registered, Affise sends it to your conversions endpoint with sub1 and the conversion details attached.

  4. The conversion is delivered to OpenAI Ads and matched to the original click.

Conversions are sent upon registration without delays.

⚠️ The setup requires adding code to your landing page and your success page, so you need to be able to maintain your website technically.


Set up integration

1. Set up OpenAI Ads as an affiliate in Affiliates > Add & Manage > New affiliate.

2. Сapture click on your landing page.
Since your ad points directly at your own page, there is no Affise tracking link to register the click. The Affise WebSDK does it from the page instead. This follows C2S cookieless tracking, Option 2.

2.1 Point your OpenAI Ads campaign at your landing page URL.

2.2 Build your destination URL in Ads Manager with three parameters:
- the {oppref} macro
- your offer ID
- the ID of your OpenAI Ads affiliate

OpenAI replaces {oppref} with the click identifier when the ad is clicked:​

Destination URL:  https://shop.example.com/landing?oppref={oppref}&offer_id=101&aff_id=456
User arrives at:  https://shop.example.com/landing?oppref=abc123xyz&offer_id=101&aff_id=456

🔎 Retaining the offer ID and affiliate ID in the URL enables a single landing page to support multiple campaigns and offers. You update the campaign’s destination URL instead of modifying the landing page code. Additionally, the Affise manager can verify these IDs directly from the campaign configuration if attribution data appears incorrect.

2.3 Add the Affise Web SDK to your landing page.
There is no tracking link, the SDK needs both your offer ID and the ID of your OpenAI Ads affiliate. This combination makes the Affise system understand which offer the click belongs to and that it came from OpenAI Ads. sub1 carries the click identifier:​

<script src="https://{your-tracking-domain}/websdk.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
ASDK.configure({ tracking_domain: 'https://{your-tracking-domain}' });

const offerId = ASDK.urlParameter('offer_id');
const affiliateId = ASDK.urlParameter('aff_id');

// Remember the offer for the success page
sessionStorage.setItem('affise_offer_id', offerId);

ASDK.click({
offer_id: offerId,
affiliate_id: affiliateId,
sub1: ASDK.urlParameter('oppref') || '',
user_agent: navigator.userAgent
})
.then(clickId => console.log('Click tracked:', clickId))
.catch(error => console.error('Click error:', error.message));
});
</script>


2.4 Add the SDK to your success (thank-you) page to register the conversion:

<script src="https://{your-tracking-domain}/websdk.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
ASDK.configure({ tracking_domain: 'https://{your-tracking-domain}' });

const offerId = sessionStorage.getItem('affise_offer_id');

ASDK.conversion({
click_id: ASDK.clickId(offerId),
offer_id: offerId,
action_id: '{your order ID}',
status: '1',
goal: '{your goal}',
order_sum: '{order total}',
order_currency: 'USD'
})
.then(() => console.log('Conversion tracked'))
.catch(error => console.error('Conversion error:', error));
});
</script>

⚠️ Use the same tracking domain in the code on the landing page and the success page. It's recommended to set up custom tracking domain. See Set up a custom tracking domain for all affiliates or Set up a custom tracking domain for a certain affiliate.

To match offer_id on both pages, it should be identical. Otherwise, the SDK cannot match the conversion to the click. The success page cannot read it from its own URL, so the landing page stores it and the success page reads it back. If your checkout already carries an order or session record, take the offer ID there instead since it survives longer than a browser session.

🔎 Pass the click identifier through unchanged. If sub1 is already in use, pick another free sub parameter and tell your Affise manager which one.

3. Get your OpenAI credentials. In Ads Manager > Conversions, get your Pixel ID and a Conversions API key.

You need to match the conversion type you want to send with OpenAI event type:

  • appointment_scheduled

  • checkout_started

  • contents_viewed

  • items_added

  • lead_created

  • order_created

  • page_viewed

  • registration_completed

  • subscription_created

  • trial_started

You also need the URL of the page where the conversion happens: your thank-you or confirmation page.

4. Get your conversions endpoint. To do this, contact your Affise account manager or support to receive your conversions endpoint for OpenAI Ads.

5. Encode your conversion page URL. The page should be URL-encoded first or it breaks the postback sending.

If the URL doesn't include ? or & signs, paste it as is or open any web page, press F12 for the browser console, and run:

encodeURIComponent('https://shop.example.com/thank-you?order=123&utm_source=openai')

Raw

https://shop.example.com/thank-you?order=123&utm_source=openai

Encoded

https%3A%2F%2Fshop.example.com%2Fthank-you%3Forder%3D123%26utm_source%3Dopenai

Encode once. Do not encode an already-encoded value.

6. Set up affiliate postback. Add the postback on the Affise side in Offers > a certain offer > Postbacks, or in Affiliates > Add & Manage > the OpenAI Ads affiliate.

Insert this as a single postback URL line:

https://conversions.affise.com/openai
?token=<your Conversions API key>
&pid=<your Pixel ID>
&type=lead_created
&id={transactionid}
&oppref={sub1}
&timestamp={timestamp}
&goal={goal}
&source_url=<your encoded conversion page URL>
&action_source=web
&amount={order_sum}
&currency={order_currency}
&ip={ip}
&uagent={uagent}
&geo={geo}

Fill in other postback fields:

  • Integration method: all.

  • Status: agree this with your Affise manager (see Timing below).

  • Goal: the goal title and value.

  • Force global postback sending: leave disabled. It would send conversions from other goals through this postback with the wrong event type.

⚠️ Use one postback per conversion type. To send both orders and leads, create two postbacks with the same token and pid but different type values, each pinned to its own goal.

Parameter reference

Parameter

What to put there

Required

token

Your Conversions API key

Yes

pid

Your Pixel ID

Yes

type

The OpenAI event type for this postback, typed literally

Yes

id

Leave as {transactionid} - prevents double counting

Yes

oppref

Leave as {sub1} - the OpenAI click ID from step 2

Yes,for attribution

timestamp

Leave as {timestamp} - conversion time

Yes

goal

Leave as {goal}

Recommended

source_url

Your encoded URL from step 5

Yes

action_source

web

Yes

amount

Leave as {order_sum} - the conversion value

Recommended

currency

Leave as {order_currency}

Required if you send amount

ip

Leave as {ip} - improves match rate

Recommended

uagent

Leave as {uagent} - improves match rate

Recommended

geo

Leave as {geo} - improves match rate

Recommended

⚠️ Parameters shown in {curly braces} are Affise macros. Leave them exactly as they are, and the system fills in the values. Everything else you type in once.

🔎 Use {order_sum} and {order_currency}, not {sum} and {currency}. {sum} is the payout to your affiliate; {order_sum} is the value of the conversion itself, which is what OpenAI Ads should optimise against. Send the value as it is, and Affise converts it to the format OpenAI expects, including currencies such as JPY that have no decimal places.

Timing

OpenAI only accepts conversions timestamped within the last 7 days. If your approval process takes longer, discuss it with your Affise manager before going live. You need to decide whether to send conversions when they are first registered or once they are approved.

7. Test the integration.

Tell your Affise manager when the postback is live. Your first conversions run in validation mode, which checks everything reaches OpenAI Ads correctly without recording anything. Once that passes, the integration is on.

Send one real test conversion and confirm it appears in Ads Manager before scaling spend against it.

To check whether Affise sent a postback, go to Statistics > Affiliate postbacks. It shows every postback the system sent or the reason it was not sent.

⚠️ Affise sends affiliate postbacks only for the conversion statuses selected in Settings > Affiliates > General > Conversion status in Affiliate panel’s statistics. If nothing is firing, check this setting first.

FAQ

  1. Do I need to remove my OpenAI pixel?
    No, keep it. The pixel and the Conversions API work together, and OpenAI deduplicates events that arrive from both.

  2. What happens if a conversion is later declined?
    It depends on the status you send. Agree this with your Affise manager during setup.

  3. Can I send conversions for more than one offer?
    Yes. Add the postback to each offer carrying OpenAI Ads traffic, or set up a global postback in Affiliate panel > Settings > Global Postbacks if you send a single event type across all offers.

  4. Can I send customer emails or phone numbers to improve matching?
    Not in this version. OpenAI supports hashed email, phone and customer ID for better matching, and we plan to add it. Today the integration sends IP address, user agent and country, which need no special handling.

  5. Does this work with app installs?

    App events work differently on OpenAI’s side and are not covered by this integration. Talk to your Affise manager about your setup.

  6. Is my API key secure?
    Your key is used only to send your conversions to your own OpenAI account. Because it is part of the postback URL, treat that URL as a secret: do not share it or paste it into public channels. You can revoke and reissue the key in Ads Manager at any time.​


Please contact the Affise Customer Support team regarding all raised questions via the e-mail: [email protected].

Did this answer your question?