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(impact): name the other impact.com source when credentials fail (#119324)

Tom Owers616a5db2e7df
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/impact/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/impact/source.py
index 3a1e027c8bfa..0023fb42fe98 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/impact/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/impact/source.py
@@ -56,7 +56,9 @@ class ImpactSource(ResumableSource[ImpactSourceConfig, ImpactResumeConfig]):
releaseStatus=ReleaseStatus.ALPHA,
caption="""Enter your impact.com Account SID and Auth Token to pull your partnership data into the PostHog Data warehouse.
-Find these in impact.com under **Settings > Technical > API**. Create a Read-Only access token, then copy its Account SID and Auth Token below.""",
+Find these in impact.com under **Settings > Technical > API**. Create a Read-Only access token, then copy its Account SID and Auth Token below.
+
+If your account is a partner (publisher) account, use the impact.com Partner source instead.""",
iconPath="/static/services/impact.png",
docsUrl="https://posthog.com/docs/cdp/sources/impact",
fields=cast(
@@ -141,7 +143,10 @@ Find these in impact.com under **Settings > Technical > API**. Create a Read-Onl
if validate_impact_credentials(config.account_sid, config.auth_token, self.resolve_api_version(api_version)):
return True, None
- return False, "Invalid Impact.com Account SID or Auth Token"
+ return False, (
+ "Your impact.com Account SID or Auth token isn't valid for a brand account. "
+ "Check both values, or use the impact.com Partner source for a partner account."
+ )
def get_resumable_source_manager(self, inputs: SourceInputs) -> ResumableSourceManager[ImpactResumeConfig]:
return ResumableSourceManager[ImpactResumeConfig](inputs, ImpactResumeConfig)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/impact/tests/test_impact_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/impact/tests/test_impact_source.py
index 9b106e3712ca..7994fc648084 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/impact/tests/test_impact_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/impact/tests/test_impact_source.py
@@ -52,7 +52,12 @@ class TestImpactSourceClass:
@parameterized.expand(
[
("valid", True, True, None),
- ("invalid", False, False, "Invalid Impact.com Account SID or Auth Token"),
+ (
+ "invalid",
+ False,
+ False,
+ "Your impact.com Account SID or Auth token isn't valid for a brand account. Check both values, or use the impact.com Partner source for a partner account.",
+ ),
]
)
def test_validate_credentials(self, _name: str, api_result: bool, ok: bool, err: Optional[str]) -> None:
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/impact_partner/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/impact_partner/source.py
index c74949b7c222..977380ca00d0 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/impact_partner/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/impact_partner/source.py
@@ -144,7 +144,10 @@ If your account is a brand (advertiser) account, use the impact.com source inste
):
return True, None
- return False, "Invalid Impact.com Account SID or Auth Token"
+ return False, (
+ "Your impact.com Account SID or Auth token isn't valid for a partner account. "
+ "Check both values, or use the impact.com source for a brand account."
+ )
def get_resumable_source_manager(self, inputs: SourceInputs) -> ResumableSourceManager[ImpactPartnerResumeConfig]:
return ResumableSourceManager[ImpactPartnerResumeConfig](inputs, ImpactPartnerResumeConfig)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/impact_partner/tests/test_impact_partner_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/impact_partner/tests/test_impact_partner_source.py
index 17355db77955..2da7d74e320e 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/impact_partner/tests/test_impact_partner_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/impact_partner/tests/test_impact_partner_source.py
@@ -40,7 +40,12 @@ class TestImpactPartnerSourceClass:
@parameterized.expand(
[
("valid", True, True, None),
- ("invalid", False, False, "Invalid Impact.com Account SID or Auth Token"),
+ (
+ "invalid",
+ False,
+ False,
+ "Your impact.com Account SID or Auth token isn't valid for a partner account. Check both values, or use the impact.com source for a brand account.",
+ ),
]
)
def test_validate_credentials(self, _name: str, api_result: bool, ok: bool, err: Optional[str]) -> None: