:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(data-warehouse): bump Meta Marketing API to v25.0 ahead of v24.0 floor (#61214)
Javier Bahamondesebf60dae83e1
diff --git a/frontend/src/mocks/fixtures/_hogFunctionTemplatesDestinations.json b/frontend/src/mocks/fixtures/_hogFunctionTemplatesDestinations.jsonindex 1a98ec09dcaa..0b8a6cb36525 100644--- a/frontend/src/mocks/fixtures/_hogFunctionTemplatesDestinations.json+++ b/frontend/src/mocks/fixtures/_hogFunctionTemplatesDestinations.json@@ -20360,7 +20360,7 @@"type": "destination","id": "template-meta-ads","name": "Meta Ads Conversions",- "hog": "let body := {\n 'data': [\n {\n 'event_name': inputs.eventName,\n 'event_id': inputs.eventId,\n 'event_time': inputs.eventTime,\n 'action_source': inputs.actionSource,\n 'user_data': {},\n 'custom_data': {}\n }\n ],\n 'access_token': inputs.accessToken\n}\n\nif (not empty(inputs.testEventCode)) {\n body.test_event_code := inputs.testEventCode\n}\n\nif (not empty(inputs.eventSourceUrl)) {\n body.data.1.event_source_url := inputs.eventSourceUrl\n}\n\nfor (let key, value in inputs.userData) {\n if (not empty(value)) {\n body.data.1.user_data[key] := value\n }\n}\n\nfor (let key, value in inputs.customData) {\n if (not empty(value)) {\n body.data.1.custom_data[key] := value\n }\n}\n\nlet res := fetch(f'https://graph.facebook.com/v21.0/{inputs.pixelId}/events', {\n 'method': 'POST',\n 'headers': {\n 'Content-Type': 'application/json',\n },\n 'body': body\n})\nif (res.status >= 400) {\n throw Error(f'Error from graph.facebook.com (status {res.status}): {res.body}')\n}",+ "hog": "let body := {\n 'data': [\n {\n 'event_name': inputs.eventName,\n 'event_id': inputs.eventId,\n 'event_time': inputs.eventTime,\n 'action_source': inputs.actionSource,\n 'user_data': {},\n 'custom_data': {}\n }\n ],\n 'access_token': inputs.accessToken\n}\n\nif (not empty(inputs.testEventCode)) {\n body.test_event_code := inputs.testEventCode\n}\n\nif (not empty(inputs.eventSourceUrl)) {\n body.data.1.event_source_url := inputs.eventSourceUrl\n}\n\nfor (let key, value in inputs.userData) {\n if (not empty(value)) {\n body.data.1.user_data[key] := value\n }\n}\n\nfor (let key, value in inputs.customData) {\n if (not empty(value)) {\n body.data.1.custom_data[key] := value\n }\n}\n\nlet res := fetch(f'https://graph.facebook.com/v25.0/{inputs.pixelId}/events', {\n 'method': 'POST',\n 'headers': {\n 'Content-Type': 'application/json',\n },\n 'body': body\n})\nif (res.status >= 400) {\n throw Error(f'Error from graph.facebook.com (status {res.status}): {res.body}')\n}","inputs_schema": [{"key": "accessToken",diff --git a/posthog/cdp/templates/meta_ads/template_meta_ads.py b/posthog/cdp/templates/meta_ads/template_meta_ads.pyindex c27fce7961ae..9822145c7905 100644--- a/posthog/cdp/templates/meta_ads/template_meta_ads.py+++ b/posthog/cdp/templates/meta_ads/template_meta_ads.py@@ -60,7 +60,7 @@ for (let key, value in inputs.customData) {}}-let res := fetch(f'https://graph.facebook.com/v21.0/{inputs.pixelId}/events', {+let res := fetch(f'https://graph.facebook.com/v25.0/{inputs.pixelId}/events', {'method': 'POST','headers': {'Content-Type': 'application/json',diff --git a/posthog/cdp/templates/meta_ads/test_template_meta_ads.py b/posthog/cdp/templates/meta_ads/test_template_meta_ads.pyindex d2b868ac819b..21e70f1b58c8 100644--- a/posthog/cdp/templates/meta_ads/test_template_meta_ads.py+++ b/posthog/cdp/templates/meta_ads/test_template_meta_ads.py@@ -31,7 +31,7 @@ class TestTemplateMetaAds(BaseHogFunctionTemplateTest):self.mock_fetch_response = lambda *args: {"status": 200, "body": {"ok": True}} # type: ignoreself.run_function(self._inputs())assert self.get_mock_fetch_calls()[0] == (- "https://graph.facebook.com/v21.0/123451234512345/events",+ "https://graph.facebook.com/v25.0/123451234512345/events",{"method": "POST","headers": {diff --git a/posthog/models/integration.py b/posthog/models/integration.pyindex f137e0f8f30d..a78563464b9f 100644--- a/posthog/models/integration.py+++ b/posthog/models/integration.py@@ -2863,7 +2863,7 @@ class GitLabIntegration:class MetaAdsIntegration:integration: Integration- api_version: str = "v23.0"+ api_version: str = "v25.0"def __init__(self, integration: Integration) -> None:if integration.kind != "meta-ads":