Skip to content

: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.

fix(data-warehouse): say how to fix a rejected AppLovin key when connecting (#126029)

Tom Owers4f4e01955026
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/applovin/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/applovin/source.py
index 902400ca9f8f..14caaacc30a5 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/applovin/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/applovin/source.py
@@ -198,7 +198,10 @@ AppLovin only serves the last 45 days of report data and the last 30 days of cam
api_version: str | None = None,
) -> tuple[bool, str | None]:
if not validate_applovin_credentials(config.api_key):
- return False, "Invalid AppLovin Report Key"
+ return (
+ False,
+ "AppLovin rejected your Report Key. Copy it again from your account menu > Keys in the AppLovin dashboard, then reconnect.",
+ )
if schema_name is not None and schema_name not in MANAGEMENT_ENDPOINTS:
return True, None
@@ -208,7 +211,10 @@ AppLovin only serves the last 45 days of report data and the last 30 days of cam
if config.campaign_api_key and config.account_id:
if not validate_management_credentials(config.campaign_api_key, config.account_id):
- return False, "Invalid AppLovin Campaign Management API key or account ID"
+ return (
+ False,
+ "AppLovin rejected your Campaign Management API key or account ID. Check both under your account menu in the AppLovin dashboard, then reconnect.",
+ )
elif schema_name in MANAGEMENT_ENDPOINTS:
return False, "Add a Campaign Management API key and account ID to sync this table."
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/applovin/tests/test_applovin_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/applovin/tests/test_applovin_source.py
index b5db25a07b4c..3f54624c464e 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/applovin/tests/test_applovin_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/applovin/tests/test_applovin_source.py
@@ -32,7 +32,11 @@ class TestAppLovinSource:
"probe_result, expected_valid, expected_message",
[
(True, True, None),
- (False, False, "Invalid AppLovin Report Key"),
+ (
+ False,
+ False,
+ "AppLovin rejected your Report Key. Copy it again from your account menu > Keys in the AppLovin dashboard, then reconnect.",
+ ),
],
)
def test_validate_credentials(
@@ -78,7 +82,10 @@ class TestAppLovinSource:
"42",
None,
ScriptedResponse(status=401),
- (False, "Invalid AppLovin Campaign Management API key or account ID"),
+ (
+ False,
+ "AppLovin rejected your Campaign Management API key or account ID. Check both under your account menu in the AppLovin dashboard, then reconnect.",
+ ),
),
("campaign-key", "42", "campaigns", ScriptedResponse(json=[]), (True, None)),
],