diff --git a/3p/vendors/affinity.js b/3p/vendors/affinity.js
new file mode 100644
index 000000000000..5730b83da6a8
--- /dev/null
+++ b/3p/vendors/affinity.js
@@ -0,0 +1,12 @@
+// src/polyfills.js must be the first import.
+import '#3p/polyfills';
+
+import {register} from '#3p/3p';
+import {draw3p, init} from '#3p/integration-lib';
+
+import {affinity} from '#ads/vendors/affinity';
+
+init(window);
+register('affinity', affinity);
+
+window.draw3p = draw3p;
diff --git a/ads/_config.js b/ads/_config.js
index 20cd191496f4..d6eb35a96dd3 100755
--- a/ads/_config.js
+++ b/ads/_config.js
@@ -286,6 +286,11 @@ const adConfig = jsonConfiguration({
renderStartImplemented: true,
},
+ 'affinity': {
+ prefetch: 'https://securepubads.g.doubleclick.net/tag/js/gpt.js',
+ preconnect: 'https://cdn4-hbs.affinitymatrix.com',
+ },
+
'aja': {
prefetch: [
'https://cdn.as.amanad.adtdp.com/sdk/asot-amp.js',
diff --git a/ads/ads.extern.js b/ads/ads.extern.js
index 7ba923a21475..3322e38357e5 100644
--- a/ads/ads.extern.js
+++ b/ads/ads.extern.js
@@ -319,6 +319,17 @@ window.andbeyond.initAmp = function (
extras
) {};
+// affinity.js
+window.affinity = {};
+window.affinity.initAMP = function (global, data) {};
+data.width;
+data.height;
+data.adtype;
+data.adslot;
+data['multi-size'];
+data.jsontargeting;
+data.extras;
+
// adreactor.js
data.zid;
data.pid;
diff --git a/ads/vendors/affinity.js b/ads/vendors/affinity.js
new file mode 100644
index 000000000000..6f709731ba62
--- /dev/null
+++ b/ads/vendors/affinity.js
@@ -0,0 +1,28 @@
+import {loadScript, validateData} from '#3p/3p';
+
+/**
+ * @param {!Window} global
+ * @param {!Object} data
+ */
+export function affinity(global, data) {
+ validateData(
+ data,
+ ['width', 'height', 'adtype', 'adslot'],
+ ['multi-size', 'jsontargeting', 'extras']
+ );
+ loadScript(
+ global,
+ 'https://securepubads.g.doubleclick.net/tag/js/gpt.js',
+ () => {
+ loadScript(
+ global,
+ 'https://cdn4-hbs.affinitymatrix.com/amp/v2022/amp.js',
+ () => {
+ (function () {
+ window.affinity.initAMP(global, data);
+ })();
+ }
+ );
+ }
+ );
+}
diff --git a/ads/vendors/affinity.md b/ads/vendors/affinity.md
new file mode 100644
index 000000000000..1c060a1e0c0c
--- /dev/null
+++ b/ads/vendors/affinity.md
@@ -0,0 +1,24 @@
+# Affinity
+
+Adtype Affinity support for AMP
+
+## Example
+
+```html
+