Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/openai-ads-server-destination.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@walkeros/server-destination-openai-ads': minor
---

New OpenAI Ads server destination for the Conversions API of ads in ChatGPT. The
mapped event name is the OpenAI event type (standard or custom); email, phone
and external id are normalised and SHA-256 hashed, the `oppref` click reference
and pixel `obref` are passed through, amounts are sent in minor units, and the
walkerOS event id deduplicates. `validate_only` tests a flow without recording
conversions.
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions packages/server/destinations/openai-ads/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<p align="left">
<a href="https://www.walkeros.io">
<img alt="walkerOS" title="walkerOS" src="https://www.walkeros.io/img/walkerOS_logo.svg" width="256px"/>
</a>
</p>

# @walkeros/server-destination-openai-ads

Server-side conversions to the OpenAI Ads (ChatGPT ads) Conversions API, with
hashed identity fields, the `oppref` click reference and deduplication on the
walkerOS event id.

[Documentation](https://www.walkeros.io/docs/destinations/server/openai-ads)
&bull;
[NPM Package](https://www.npmjs.com/package/@walkeros/server-destination-openai-ads)
&bull;
[Source Code](https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/openai-ads)

## Installation

```bash
npm install @walkeros/server-destination-openai-ads
```

## Quick start

```json
{
"version": 4,
"flows": {
"default": {
"config": { "platform": "server" },
"destinations": {
"openai-ads": {
"package": "@walkeros/server-destination-openai-ads",
"config": {
"settings": {
"apiKey": "$secret.OPENAI_ADS_API_KEY",
"pixelId": "YOUR_PIXEL_ID"
}
}
}
}
}
}
}
```

This quick start sets no consent: add `consent: { marketing: true }` to `config`
before you go live, see the docs.

## Documentation

Full configuration, mapping, and examples live in the docs:
**https://www.walkeros.io/docs/destinations/server/openai-ads**

## Contribute

Feel free to contribute by submitting an
[issue](https://github.com/elbwalker/walkerOS/issues), starting a
[discussion](https://github.com/elbwalker/walkerOS/discussions), or getting in
[contact](https://calendly.com/elb-alexander/30min).

## License

MIT
5 changes: 5 additions & 0 deletions packages/server/destinations/openai-ads/jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import baseConfig from '@walkeros/config/jest';

const config = {};

export default { ...baseConfig, ...config };
77 changes: 77 additions & 0 deletions packages/server/destinations/openai-ads/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "@walkeros/server-destination-openai-ads",
"description": "OpenAI Ads (ChatGPT ads) Conversions API server destination for walkerOS",
"version": "4.9.0",
"license": "MIT",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dev": {
"types": "./dist/dev.d.ts",
"import": "./dist/dev.mjs",
"require": "./dist/dev.js"
},
"./walkerOS.json": "./dist/walkerOS.json",
"./examples": {
"types": "./dist/examples/index.d.ts",
"import": "./dist/examples/index.mjs",
"require": "./dist/examples/index.js"
}
},
"files": [
"dist/**",
"CHANGELOG.md"
],
"scripts": {
"build": "tsup --silent",
"clean": "rm -rf .turbo && rm -rf dist",
"dev": "jest --watchAll --colors",
"typecheck": "tsc --noEmit",
"lint": "eslint \"**/*.ts*\"",
"test": "jest",
"update": "npx npm-check-updates -u && npm update"
},
"dependencies": {
"@walkeros/core": "4.9.0",
"@walkeros/server-core": "4.9.0"
},
"devDependencies": {
"@walkeros/collector": "4.9.0"
},
"repository": {
"url": "git+https://github.com/elbwalker/walkerOS.git",
"directory": "packages/server/destinations/openai-ads"
},
"author": "elbwalker <hello@elbwalker.com>",
"homepage": "https://github.com/elbwalker/walkerOS#readme",
"bugs": {
"url": "https://github.com/elbwalker/walkerOS/issues"
},
"walkerOS": {
"type": "destination",
"platform": [
"server"
],
"docs": "https://www.walkeros.io/docs/destinations/server/openai-ads"
},
"keywords": [
"walkerOS",
"walkerOS-destination",
"destination",
"server",
"openai",
"chatgpt",
"ads",
"conversions-api",
"analytics"
],
"funding": [
{
"type": "GitHub Sponsors",
"url": "https://github.com/sponsors/elbwalker"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import path from 'path';
import { conformance } from '@walkeros/collector/dev';
import { destinationOpenAIAds } from '..';
import { examples, schemas } from '../dev';

describe('openai-ads conformance', () => {
beforeEach(() => {
jest.useRealTimers();
});

it('conforms', async () => {
await conformance('destination', destinationOpenAIAds, {
profile: 'http',
examples: examples.step,
schema: schemas.settings,
settings: examples.minimal.settings,
minimal: examples.minimal,
root: path.join(__dirname, '..', '..'),
});
});
});
Loading