: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
feat(customer-analytics): show company logos in the accounts list (#87276)
Luke Baberf204b8aed0d5
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex e634d664b32d..a8dedd063047 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -5845,41 +5845,41 @@ snapshots:scenes-app-batchexports--runs-with-data--light:hash: v1.k794b7964.4c1646577dc53efffd814b1a2e723f9da6b10d3641e979f48c5d0447859e2348.fkHuUw1l_9c3rJKSi467jx-6Nv81nNp-PjeRmsgU7l0scenes-app-customer-analytics-accounts--default--dark:- hash: v1.k794b7964.90addf15179ed1e64060e0d035eedb9b8eef9af68590760316274259f2890136.WGMgyL6Xiave3FRnl-w6jcTbUhMrxwq1CFGt1iqdpRE+ hash: v1.k794b7964.5029cc9636cf8a1e93b707e9d48d905b30662613b481927d0cb56d546dc10317.VZw3U--3gG98gmwGFU0AFNw2XsDFWKQD5KIfMq2y-p8scenes-app-customer-analytics-accounts--default--light:- hash: v1.k794b7964.faa5deb2da376bb4364cc185f6ca36d5ef4e5f12af269420f106569f0847011d.I72hc0cqrIF69Nf3LBXC_FxP4Wb9n8qYouNiokLvDv4+ hash: v1.k794b7964.a6e69d146704a3f3a20505299fbae7d8f43e4f5a4747e9f11f6503cb0d456706.yHgdwBuqrbDdiWI1YHHNt8Zr43DwZ4nKhUjal7A8KVMscenes-app-customer-analytics-accounts--empty--dark:- hash: v1.k794b7964.335e429043f942468f4d038a2089b48bc2e2c4fd02dff40af100bb8e46e9731a.0yyxMsPpYP8LN8AMi5eNS6uZqCB5w0EQKMKSXfxoqtQ+ hash: v1.k794b7964.d5cb3b149fb59116acfcf317da2d09c92f5ea04343c1573380f7470e1102293d._xJcGDJwr0jVFV1gRN3XL1aISaN1AURfT_GePQ4aXBoscenes-app-customer-analytics-accounts--empty--light:- hash: v1.k794b7964.3cf93a7ca9fe5453e14210067583f16a552a95cdf5882a11ec97ef1b57b35c68.OukR8G27tpqoK_OXjeHBf4HvZPbFTFQ04lipBl4DsFc+ hash: v1.k794b7964.05948f6f2364874e0636e340a4b6c5356c63fa3f8968aa42c694d706d2b91876.yOkLiE5so_xwbPJnuckUsEwHPuIuFEL3vh3xmzUdyaEscenes-app-customer-analytics-accounts--feature-gate-off--dark:hash: v1.k794b7964.4b8d5226ee154debdf333ff93d65a90ca766bcb25951e1baf36affb8b84b548d.dWZSHssPc83RkHVE-JPJA562bJR7MUim2yfqhjfNE50scenes-app-customer-analytics-accounts--feature-gate-off--light:hash: v1.k794b7964.e8b91bf6a0dd1b5d31064f4cbb94e9791e999c210831c455a498d0c7cc7e6bbb.IkZPJrJz33sKS8zzKwoy8V3s0GvmKpe5EGYTCIljhLsscenes-app-customer-analytics-accounts--row-expanded-conversations--dark:- hash: v1.k794b7964.c83d3e0351279053117a4376654ece30522ea04e0d17a21d084e58be220395e9.coxsJkBmbXdsAZSUNvss_RtW7LQ6MVRxvqbiW61JfQI+ hash: v1.k794b7964.6ae47bc00326e5b1f9e1dfef13182cad9becfc989f2507d5b2d225d317847e45.1HnLBIw57ILVXFcmDVI1W3JYwbhnga_MYTjwVyVBx34scenes-app-customer-analytics-accounts--row-expanded-conversations--light:- hash: v1.k794b7964.9ffbe7d6153dbbd3812945e1f0e70e48bf941371a6d8b30027d0b0eab61f98e4.86uwFxkcB9kgOSyT445fxXt_x_ckpJp3GRukqn62BGY+ hash: v1.k794b7964.3e4daf872eb81f88fbbf8809a32c5d62ec190b9751b4c200dc03d0f47238c64b.2_R_yhblfgfj3v92VWL5V9j9i03ZsKial9L-DO3YL6sscenes-app-customer-analytics-accounts--row-expanded-empty--dark:- hash: v1.k794b7964.89995158723a826e4604ddfcf9681dc0c9b50f33219cfccd06ccce637fe1b65b.i40Oi8tI3Ey-wqAdh3EekF8ti9WEdjq6dx-6JQPSvA0+ hash: v1.k794b7964.64c6a97719eac3694328d10e98e08b7fab6efb7ce58e32bc891c5c875491009f.qkTtsSosk3TlRtMfGCAJ-uadqBXTMgS4PXKWVTbc-mMscenes-app-customer-analytics-accounts--row-expanded-empty--light:- hash: v1.k794b7964.9e34cdbfa99277db4e17ef52314317b9523ac737c8285b972460baa2b993e8ea.EQ8z6F2X7fhbbuoIctopbwQcd2nqhfDcwzEmlLgEAlM+ hash: v1.k794b7964.711908526edcaa97feeba398ed8acd1fc433f59b91147ee5622baf333a8b0387.4zfYB2NnD0ezvuJ0cdbFkTwh7-mBuVvcbypPaYzXJvgscenes-app-customer-analytics-accounts--row-expanded-feature-requests--dark:- hash: v1.k794b7964.3550178b721e91fc806f841754bba3a3fdd2e0fdd2a8674cb2af773fd7ddad49.zXeWz2rgJxGeGlCJpmfj7fgjIGOw3P7UEZsRf7iaoGs+ hash: v1.k794b7964.ee4d66f4cf3a0774cb7f5f190f8763daad66096461c047fd14dd1feb9bb9fe47.wjaeSgN4fZB7YP6VYHbH_1s3GkpXkZdtiI6hE_57D9oscenes-app-customer-analytics-accounts--row-expanded-feature-requests--light:- hash: v1.k794b7964.8225a7127c4179a088f46b4d7270b83b8decc122bb710a878f9bfafe7f7afaff.RJnBr8vuWuo3tLUIYEACwxXK_zklbfEiCLk5CGjzTwY+ hash: v1.k794b7964.6db810d612de656d8e16ef2fa28601e2adeaee561be28226ed5848f4c947b56f.MBjkBaRfn3pDvYzb5hO1yUorHjMQmWVh27V-Nr4WCq0scenes-app-customer-analytics-accounts--row-expanded-links-disabled--dark:- hash: v1.k794b7964.385a63b277ab9041131f99759cf602d06443de6cc4e41333603d1187d64b6954.sQ8rSdSRp6Hbyvu_itGLdKOfbKjxjMSO_rxHaY4nP_0+ hash: v1.k794b7964.d7c0995e7588ede95f66f7235d94a3f6f0d73306f1a27cfe3a91845fc76e9bd8.SgPuM2YRTP9H2lX07PuntHqO12du3Fdtv3yYFEwLySEscenes-app-customer-analytics-accounts--row-expanded-links-disabled--light:- hash: v1.k794b7964.f0b2c185b0a9587edc280cb10f5e1917b05527e8218dc3bf745e23a3554c224d.zAJKffRe5BstVe68Qdk9rLyZr937OsLrmJXQrPYynx4+ hash: v1.k794b7964.2a29bb01d732bb6328279c9c987264c3078a413d735cdff248c0f959695c7c64.W3o2IkXVgAnetRbVA4iHULghtZGBps1dlYtDS-OmLWYscenes-app-customer-analytics-accounts--row-expanded-usage-not-found--dark:- hash: v1.k794b7964.2b808e25f00ad2e3368b04d4a47e4faac7893d55f7ea8371c7c1cafc35c52536.zItumxxVofp2swh3Vq3Qz63JQmcvGseX8wdZRgOsuU4+ hash: v1.k794b7964.7f047195753fa396612db252f801d05b1c1f0092a9b6c05f5ad955db9ca3f719.GkW15w-pinFn2gQlWyqlggJIGMHlIgK3Ke1K6ETIVa0scenes-app-customer-analytics-accounts--row-expanded-usage-not-found--light:- hash: v1.k794b7964.6daf7da6b08f898cecd3ba6564bfe299cccaec8584e8b9b369b472daf4478ec9.ovxGnefEu6NiHHJaxUefBQkG0LsexH2oVEhpSuwXy7c+ hash: v1.k794b7964.074c9d6046ed7e22cfff1c0c18ebffdb385feaf292db3d988097875d9e33ba5d.GuicCf-sDnbmmfufgRnrJNqAQVVpy9vGEhk1WvG6l7sscenes-app-customer-analytics-accounts--row-expanded-with-note--dark:- hash: v1.k794b7964.51cb259a2c15fffd01faba298f9dc78e545e41a5c645a36558f4b0099e1fb13b.p5Z_YR55_z21ZLe8GhPEzIYdxnP3E2im9Ug9gdCFhX4+ hash: v1.k794b7964.fe81f917cde0cd236fdc089c4f199bf47e857f460034a4c4bcbe9aa66a414dfe.WtPEGr3dP6WOiXPqTlvuOu6GB0L7uExwtuVAaADo_qUscenes-app-customer-analytics-accounts--row-expanded-with-note--light:- hash: v1.k794b7964.cd3a16daa69e96a5aaff1c285abd83819ac41c7af57f9d0f95f76fd5c8ed33ac.3xfRcw5si_dACFzJVLIocauVC1RCZgwwXnxnRJTlOh4+ hash: v1.k794b7964.74290c56ba027ddda9acd7151eddd87dddeb8c23dd62de38090c80849982f8a9.Ro118m45cILMTdu2kf1TXFDbKpa_UjNizxLkM71jzIQscenes-app-customer-analytics-dashboard--b-2-b-mode-with-groups-enabled--dark:hash: v1.k794b7964.cf03f6a65f846aec287042028193b834c567f01226d2e91f6389df5af935530d.bXzRv9MkU0nXN-4tvGbenagVaJuhFr86goke8HVYFJYscenes-app-customer-analytics-dashboard--b-2-b-mode-with-groups-enabled--light:diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.jsonindex 04cca107b06c..8619c7445a13 100644--- a/frontend/src/queries/schema.json+++ b/frontend/src/queries/schema.json@@ -778,6 +778,10 @@"id": {"type": "string"},+ "logoDomain": {+ "description": "Bare hostname the row's logo is rendered from. Null when no source resolved one.",+ "type": ["string", "null"]+ },"name": {"type": "string"},diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.tsindex fdd544e7fb15..515583368fae 100644--- a/frontend/src/queries/schema/schema-general.ts+++ b/frontend/src/queries/schema/schema-general.ts@@ -3045,6 +3045,8 @@ export interface AccountsTableRow {id: stringname: stringexternalId?: string | null+ /** Bare hostname the row's logo is rendered from. Null when no source resolved one. */+ logoDomain?: string | null/** Requested direct Account fields, keyed by their typed field reference. */accountFields: Record<string, string | null>/** Sorted tag names. Omitted when the request does not select tags. */diff --git a/posthog/schema.py b/posthog/schema.pyindex 9fba270a1936..06f2f2d286e7 100644--- a/posthog/schema.py+++ b/posthog/schema.py@@ -3177,6 +3177,10 @@ class AccountsTableRow(BaseModel):)externalId: str | None = Noneid: str+ logoDomain: str | None = Field(+ default=None,+ description=("Bare hostname the row's logo is rendered from. Null when no source resolved one."),+ )name: strnoteCount: int | None = Field(default=None,diff --git a/products/customer_analytics/backend/domain.py b/products/customer_analytics/backend/domain.pynew file mode 100644index 000000000000..3b6f0b62e7ea--- /dev/null+++ b/products/customer_analytics/backend/domain.py@@ -0,0 +1,32 @@+import re+from urllib.parse import urlsplit++from free_email_domains import whitelist as free_email_domains++_HOSTNAME_RE = re.compile(r"^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$")+_MAX_DOMAIN_LENGTH = 253+_MAILBOX_PROVIDER_DOMAINS = frozenset(free_email_domains) | {"proton.me"}+++def parse_company_domain(raw: str | None) -> str | None:+ if not raw:+ return None++ value = raw.strip().lower().removeprefix("@")+ if not value:+ return None++ url_value = value if "://" in value or value.startswith("//") else f"//{value}"+ try:+ host = urlsplit(url_value).hostname+ except ValueError:+ return None++ if not host:+ return None++ host = host.rstrip(".").removeprefix("www.")+ if len(host) > _MAX_DOMAIN_LENGTH or not _HOSTNAME_RE.match(host):+ return None++ return None if host in _MAILBOX_PROVIDER_DOMAINS else hostdiff --git a/products/customer_analytics/backend/facade/api.py b/products/customer_analytics/backend/facade/api.pyindex d4a3f6283fd6..9f89b9356390 100644--- a/products/customer_analytics/backend/facade/api.py+++ b/products/customer_analytics/backend/facade/api.py@@ -104,6 +104,7 @@ from products.customer_analytics.backend.logic import (relationships as _relationships_logic,)from products.customer_analytics.backend.logic.account_filters import InvalidAccountFilter, apply_account_filters+from products.customer_analytics.backend.logic.account_logo import resolve_logo_domainfrom products.customer_analytics.backend.logic.custom_property_definitions import (apply_option_side_effects,coerce_is_big_number,@@ -184,6 +185,7 @@ if TYPE_CHECKING:def _to_account_properties(properties: _ModelAccountProperties) -> contracts.AccountProperties:return contracts.AccountProperties(+ website_domain=properties.website_domain,stripe_customer_id=properties.stripe_customer_id,hubspot_deal_id=properties.hubspot_deal_id,billing_id=properties.billing_id,@@ -2903,6 +2905,14 @@ def query_accounts_metrics(return results+def _resolve_account_logo_domain(account: Account) -> str | None:+ properties = account.properties+ return resolve_logo_domain(+ website_domain=properties.website_domain,+ email_domains=properties.email_domains,+ )++def query_accounts_table(*,team_id: int,@@ -3030,6 +3040,7 @@ def query_accounts_table(id=account.id,name=account.name,external_id=account.external_id,+ logo_domain=_resolve_account_logo_domain(account),account_fields=_account_table_field_values(account, selection.account_fields),tags=tags_by_account[account.id] if selection.include_tags else None,note_count=note_counts_by_account[account.id] if selection.include_note_count else None,diff --git a/products/customer_analytics/backend/facade/contracts.py b/products/customer_analytics/backend/facade/contracts.pyindex 0bef9a098339..4b3da6398ff7 100644--- a/products/customer_analytics/backend/facade/contracts.py+++ b/products/customer_analytics/backend/facade/contracts.py@@ -70,6 +70,7 @@ class AccountProperties:Mirrors ``models.account.AccountProperties`` as a stable, framework-free shape."""+ website_domain: str | None = Nonestripe_customer_id: str | None = Nonehubspot_deal_id: str | None = Nonebilling_id: str | None = None@@ -434,6 +435,7 @@ class AccountTableRow:id: UUIDname: strexternal_id: str | None+ logo_domain: str | None = Noneaccount_fields: dict[AccountTableField, str | None] = field(default_factory=dict)tags: list[str] | None = Nonenote_count: int | None = Nonediff --git a/products/customer_analytics/backend/hogql_queries/accounts_table_query_runner.py b/products/customer_analytics/backend/hogql_queries/accounts_table_query_runner.pyindex 7adcf958916d..7c3fd14e6c05 100644--- a/products/customer_analytics/backend/hogql_queries/accounts_table_query_runner.py+++ b/products/customer_analytics/backend/hogql_queries/accounts_table_query_runner.py@@ -271,6 +271,7 @@ class AccountsTableQueryRunner(AnalyticsQueryRunner[AccountsTableQueryResponse])id=str(row.id),name=row.name,externalId=row.external_id,+ logoDomain=row.logo_domain,accountFields={field.value: value for field, value in row.account_fields.items()},tags=row.tags,noteCount=row.note_count,diff --git a/products/customer_analytics/backend/hogql_queries/test/test_accounts_table_query_runner.py b/products/customer_analytics/backend/hogql_queries/test/test_accounts_table_query_runner.pyindex c8c153077bd1..06d3a8fe8bc6 100644--- a/products/customer_analytics/backend/hogql_queries/test/test_accounts_table_query_runner.py+++ b/products/customer_analytics/backend/hogql_queries/test/test_accounts_table_query_runner.py@@ -330,6 +330,34 @@ class TestAccountsTableQueryRunner(BaseTest):assert {row.custom_properties[definition.id] for row in page.rows} == {0.0, 1.0, 2.0}+ def test_resolves_the_logo_domain_from_account_properties(self) -> None:+ from_website_domain = create_account(+ team_id=self.team.id,+ name="From website domain",+ _properties={"website_domain": "acme.example", "email_domains": ["other.example"]},+ )+ from_email_domains = create_account(+ team_id=self.team.id,+ name="From email domains",+ _properties={"email_domains": ["globex.example"]},+ )+ from_external_id = create_account(team_id=self.team.id, name="From external ID", external_id="legacy.example")++ page = api.query_accounts_table(+ team_id=self.team.id,+ user_access_control=UserAccessControl(user=self.user, team=self.team),+ selection=contracts.AccountTableColumnSelection(),+ filters=(),+ sort=None,+ offset=0,+ limit=100,+ )++ logo_domains = {row.id: row.logo_domain for row in page.rows}+ assert logo_domains[from_website_domain.id] == "acme.example"+ assert logo_domains[from_email_domains.id] == "globex.example"+ assert logo_domains[from_external_id.id] is None+def test_caps_selected_columns_metrics_and_page_size(self) -> None:with self.assertRaises(ValidationError):self._run(AccountsTableQuery(columns=[AccountsTableTagsColumn()] * (ACCOUNTS_TABLE_MAX_COLUMNS + 1)))diff --git a/products/customer_analytics/backend/logic/account_logo.py b/products/customer_analytics/backend/logic/account_logo.pynew file mode 100644index 000000000000..8d56573cdc06--- /dev/null+++ b/products/customer_analytics/backend/logic/account_logo.py@@ -0,0 +1,14 @@+from collections.abc import Iterable++from products.customer_analytics.backend.domain import parse_company_domain+++def resolve_logo_domain(*, website_domain: str | None, email_domains: Iterable[str]) -> str | None:+ if website_domain:+ return website_domain++ for email_domain in email_domains:+ domain = parse_company_domain(email_domain)+ if domain:+ return domain+ return Nonediff --git a/products/customer_analytics/backend/logic/account_logo_test.py b/products/customer_analytics/backend/logic/account_logo_test.pynew file mode 100644index 000000000000..6572be631d94--- /dev/null+++ b/products/customer_analytics/backend/logic/account_logo_test.py@@ -0,0 +1,51 @@+from parameterized import parameterized++from products.customer_analytics.backend.domain import parse_company_domain+from products.customer_analytics.backend.logic.account_logo import resolve_logo_domain+++class TestParseCompanyDomain:+ @parameterized.expand(+ [+ ("bare", "posthog.com", "posthog.com"),+ ("uppercase", "PostHog.COM", "posthog.com"),+ ("surrounding whitespace", " posthog.com ", "posthog.com"),+ ("email suffix", "@posthog.com", "posthog.com"),+ ("www prefix", "www.posthog.com", "posthog.com"),+ ("full url", "https://www.posthog.com/pricing?ref=x", "posthog.com"),+ ("scheme relative url", "//posthog.com", "posthog.com"),+ ("host and port", "posthog.com:8000", "posthog.com"),+ ("fully qualified trailing dot", "posthog.com.", "posthog.com"),+ ("subdomain kept", "eu.posthog.com", "eu.posthog.com"),+ ]+ )+ def test_reduces_stored_value_to_bare_hostname(self, _name: str, raw: str, expected: str) -> None:+ assert parse_company_domain(raw) == expected++ @parameterized.expand(+ [+ ("none", None),+ ("empty", ""),+ ("whitespace only", " "),+ ("no dot", "posthog"),+ ("uuid group key", "0192d900-d620-0000-46a9-f9a712425410"),+ ("free text", "Acme Corporation"),+ ("mailbox provider", "gmail.com"),+ ("mailbox provider as email suffix", "@outlook.com"),+ ("unbracketed ipv6", "//[::1"),+ ("label over 63 characters", f"{'a' * 64}.com"),+ ]+ )+ def test_returns_none_for_values_that_are_not_a_company_hostname(self, _name: str, raw: str | None) -> None:+ assert parse_company_domain(raw) is None+++class TestResolveLogoDomain:+ def test_prefers_the_normalized_website_domain(self) -> None:+ assert resolve_logo_domain(website_domain="acme.example", email_domains=["mail.example"]) == "acme.example"++ def test_falls_back_through_email_domains_that_do_not_resolve(self) -> None:+ assert resolve_logo_domain(website_domain=None, email_domains=["gmail.com", "acme.example"]) == "acme.example"++ def test_returns_none_when_no_source_resolves(self) -> None:+ assert resolve_logo_domain(website_domain=None, email_domains=[]) is Nonediff --git a/products/customer_analytics/backend/models/account.py b/products/customer_analytics/backend/models/account.pyindex 8ba473b56d7c..c484232f8153 100644--- a/products/customer_analytics/backend/models/account.py+++ b/products/customer_analytics/backend/models/account.py@@ -5,11 +5,12 @@ from django.db.models import JSONField, Qfrom django.db.models.signals import pre_savefrom django.dispatch import receiver-from pydantic import BaseModel, ConfigDict, field_validator+from pydantic import BaseModel, ConfigDict, ValidationInfo, field_validatorfrom posthog.models.scoping.root_mixin import TeamScopedRootMixinfrom posthog.models.utils import CreatedMetaFields, UpdatedMetaFields, UUIDModel+from products.customer_analytics.backend.domain import parse_company_domainfrom products.customer_analytics.backend.models.account_channel_summary import SlackSummaryCadence# Role assignments moved to the relationship tables. Stored rows may carry these keys until@@ -20,6 +21,7 @@ RETIRED_ROLE_KEYS = ("csm", "account_executive", "account_owner")class AccountProperties(BaseModel):model_config = ConfigDict(extra="forbid")+ website_domain: str | None = None# Email domains owned by this account's company, used to match inbound# touchpoints (calendar attendees, email senders) that don't resolve to a# known person. Personal/free domains don't belong here.@@ -28,6 +30,18 @@ class AccountProperties(BaseModel):# fallback. For contacts on personal/free domains a domain rule can't cover.known_emails: list[str] = []+ @field_validator("website_domain")+ @classmethod+ def normalize_website_domain(cls, raw_domain: str | None, info: ValidationInfo) -> str | None:+ if not info.context or not info.context.get("normalize_website_domain"):+ return raw_domain+ if raw_domain is None or not raw_domain.strip():+ return None+ domain = parse_company_domain(raw_domain)+ if domain is None:+ raise ValueError("website_domain must be a company hostname")+ return domain+@field_validator("email_domains")@classmethoddef normalize_email_domains(cls, domains: list[str]) -> list[str]:@@ -54,7 +68,7 @@ class AccountProperties(BaseModel):def from_input(cls, data: "dict | AccountProperties") -> "AccountProperties":if isinstance(data, AccountProperties):data = data.model_dump(mode="json", exclude_unset=True)- return cls.model_validate(data)+ return cls.model_validate(data, context={"normalize_website_domain": True})class Account(TeamScopedRootMixin, UUIDModel, CreatedMetaFields, UpdatedMetaFields):@@ -84,7 +98,7 @@ class Account(TeamScopedRootMixin, UUIDModel, CreatedMetaFields, UpdatedMetaFiel@properties.setterdef properties(self, value: "dict | AccountProperties") -> None:- validated = value if isinstance(value, AccountProperties) else AccountProperties.model_validate(value)+ validated = AccountProperties.from_input(value)self._properties = validated.model_dump(mode="json")diff --git a/products/customer_analytics/backend/models/account_test.py b/products/customer_analytics/backend/models/account_test.pyindex 4e6e0cea3861..a89b2dcd1980 100644--- a/products/customer_analytics/backend/models/account_test.py+++ b/products/customer_analytics/backend/models/account_test.py@@ -28,13 +28,16 @@ class AccountPropertiesValidationTest(TeamScopedTestMixin, BaseTest):def test_typed_property_round_trip_through_setter(self):account = Account.objects.create(team=self.team, name="Round-trip")- account.properties = AccountProperties(stripe_customer_id="cus_1")+ account.properties = AccountProperties(+ stripe_customer_id="cus_1", website_domain="https://www.acme.example/about"+ )account.save()account.refresh_from_db()props = account.propertiesassert isinstance(props, AccountProperties)assert props.stripe_customer_id == "cus_1"+ assert props.website_domain == "acme.example"assert props.sfdc_id is Nonedef test_getter_ignores_retired_role_keys_in_stored_rows(self):diff --git a/products/customer_analytics/backend/presentation/views/serializers.py b/products/customer_analytics/backend/presentation/views/serializers.pyindex 36b27982728c..e41d7304e72a 100644--- a/products/customer_analytics/backend/presentation/views/serializers.py+++ b/products/customer_analytics/backend/presentation/views/serializers.py@@ -199,6 +199,11 @@ _ACCOUNT_PROPERTIES_SCHEMA = {"type": "object","additionalProperties": False,"properties": {+ "website_domain": {+ "type": "string",+ "nullable": True,+ "description": "Primary company website hostname used for account identity and logo lookup.",+ },"email_domains": {"type": "array","items": {"type": "string"},@@ -903,9 +908,9 @@ class AccountSerializer(DataclassSerializer):required=False,allow_null=True,help_text=(- "Typed account properties: external system identifiers (stripe_customer_id, "+ "Typed account properties: website_domain, external system identifiers (stripe_customer_id, ""hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, "- "usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains "+ "usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains ""(the company's email domains) and known_emails (individual addresses pinned to the ""account). Defaults to an empty object. Unknown keys are rejected. User assignments ""live on account relationships, not here."diff --git a/products/customer_analytics/backend/presentation/views/views.py b/products/customer_analytics/backend/presentation/views/views.pyindex 0d334a2ad51e..a01e2ae85eb0 100644--- a/products/customer_analytics/backend/presentation/views/views.py+++ b/products/customer_analytics/backend/presentation/views/views.py@@ -18,7 +18,10 @@ from dataclasses import asdictfrom typing import Any, castfrom uuid import UUID+from django.core.exceptions import ValidationError as DjangoValidationError+from django.core.validators import DomainNameValidatorfrom django.db import transaction+from django.http import HttpResponsefrom drf_spectacular.types import OpenApiTypesfrom drf_spectacular.utils import OpenApiParameter, OpenApiResponse, extend_schema@@ -33,6 +36,7 @@ from rest_framework.throttling import UserRateThrottlefrom posthog.api.mixins import ValidatedRequest, validated_requestfrom posthog.api.routing import TeamAndOrgViewSetMixinfrom posthog.api.tagged_item import TaggedItemViewSetMixin+from posthog.cdp.services.icons import CDPIconsServicefrom posthog.event_usage import report_user_actionfrom posthog.exceptions import Conflictfrom posthog.helpers.impersonation import is_impersonated@@ -109,6 +113,8 @@ from ee.hogai.tools.create_notebook.tiptap import markdown_to_tiptap_nodes_OBJECT_READ_LEVEL = "viewer"_OBJECT_WRITE_LEVEL = "editor"+_ICON_DOMAIN_VALIDATOR = DomainNameValidator(accept_idna=False)+# The warehouse resources a person/group-property source can bind to: the import source behind a# table, or a materialized view. Each needs its own API-token scope folded into the object check.@@ -1764,6 +1770,25 @@ class AccountViewSet(return ["account:read", "ticket:read"]return None+ # Image bytes for <img src>; deliberately outside the typed client surface.+ @extend_schema(exclude=True)+ @action(methods=["GET"], detail=False, required_scopes=["account:read"])+ def icon(self, request: Request, *args, **kwargs) -> HttpResponse:+ domain = request.query_params.get("domain", "").strip().lower().rstrip(".")+ try:+ _ICON_DOMAIN_VALIDATOR(domain)+ except DjangoValidationError:+ raise ValidationError("domain must be a bare hostname, e.g. posthog.com")+ theme = request.query_params.get("theme")+ return CDPIconsService().get_icon_http_response(+ domain,+ # Bound cache keys to the themes logo.dev supports.+ theme=theme if theme in ("light", "dark") else None,+ # AccountLogo renders its own lettermark on 404 instead of logo.dev's monogram.+ fallback="404",+ team_id=self.team_id,+ )+def create(self, request: Request, *args, **kwargs) -> Response:serializer = AccountSerializer(data=request.data)serializer.is_valid(raise_exception=True)diff --git a/products/customer_analytics/backend/test/test_views.py b/products/customer_analytics/backend/test/test_views.pyindex 80b403756004..a944e66e63a6 100644--- a/products/customer_analytics/backend/test/test_views.py+++ b/products/customer_analytics/backend/test/test_views.py@@ -565,7 +565,7 @@ class TestAccountViewSet(APIBaseTest):f"{self.endpoint_base}{account.id}/",{"name": "Renamed",- "properties": {"sfdc_id": "001xx"},+ "properties": {"sfdc_id": "001xx", "website_domain": "https://www.acme.example/about"},},format="json",)@@ -574,6 +574,7 @@ class TestAccountViewSet(APIBaseTest):account.refresh_from_db()self.assertEqual(account.name, "Renamed")self.assertEqual(account.properties.sfdc_id, "001xx")+ self.assertEqual(account.properties.website_domain, "acme.example")def test_update_does_not_accept_ignored_at(self):ignored_at = timezone.now()diff --git a/products/customer_analytics/frontend/components/Accounts/AGENTS.md b/products/customer_analytics/frontend/components/Accounts/AGENTS.mdindex 6564003a5986..d440007684ce 100644--- a/products/customer_analytics/frontend/components/Accounts/AGENTS.md+++ b/products/customer_analytics/frontend/components/Accounts/AGENTS.md@@ -58,7 +58,7 @@ AccountsTabContent ── binds dataNodeLogic(ACCOUNTS_TABLE_DATA_NODE_KEY, acc| `accountEmailThreadsLogic` | Matched email communication used by the Conversations tab (keyed by `accountId`): fetches server-paginated summaries from `accountsEmailThreadsList`, keeps one row expanded, and fetches paginated ordered messages through `accountsEmailThreadMessagesList`. The current message page is cached while the row remains expanded; list and detail failures leave explicit retry guidance instead of an infinite skeleton. || `accountConversationsLogic` | The unified Conversations timeline (keyed by `accountId`): loads email, Support, and Slack independently so one denied or failed source does not blank successful sources; merges them newest-first; owns search, source filters, expansion state, Support message loading, and collapsed Slack message links. It preserves email and Slack response counts and loads older source pages on demand instead of silently limiting search to the first 50 rows. || `accountMeetingsLogic` | The Meetings tab (keyed by `accountId`): fetches synced calendar meetings from the generated `accountsMeetingsList` endpoint (customer-analytics facade `get_account_meetings` over the `Meeting` model, populated by the Google Calendar Temporal sync). Distinguishes not-loaded / loaded-empty / load-failed; captures unexpected failures. Also owns the project-admin-gated "Edit matching" editor: `email_domains` / `known_emails` drafts, normalization (trim, lowercase, strip a leading `@`, dedupe), and `saveMatching` — merges them into the account's `properties` via `accountsPartialUpdate` (guarded by `savingMatching`) and propagates the updated account through `accountLinksLogic.loadAccountSuccess` (it connects to that logic for the account instead of fetching its own copy). |-| `accountLinksLogic` | The "Useful links" sidebar for one account (keyed by `accountId`). |+| `accountLinksLogic` | The "Useful links" sidebar and editor for one account (keyed by `accountId`). The editor updates `website_domain` and external links through `accountsPartialUpdate` without replacing unrelated account properties. |## Data & query model@@ -68,9 +68,22 @@ Ignored accounts (`ignored_at IS NOT NULL`) are excluded from list rows and overOverview tiles run as a separate metrics-only `AccountsTableQuery` (`metrics` set and `columns: []`; `null` when there are no tiles or while definitions are loading). Count, sum, average, minimum, maximum, median, scaling, and threshold counts execute in Postgres. The "My accounts" checkbox resolves to the current user's explicit ID before either query is built, so shared URLs remain viewer-independent. Two cell shapes matter:-- **`name` column** (mandatory, `ACCOUNTS_NAME_COLUMN`) — read directly from the keyed row's `id`, `name`, and `externalId`. This is the row's identity: `id` (the account PK) drives expansion/scroll/role updates; `externalId` is the copy-able group key. `getNameCell()` in `AccountsTable.tsx` is the canonical accessor. `AccountNameCell.tsx` owns the shared name, deep link, and copyable external ID presentation. The Accounts list wraps it with inline expansion behavior and fires `AccountOpened` when a plain click opens a row. Other account tables reuse it with normal deep-link navigation.+- **`name` column** (mandatory, `ACCOUNTS_NAME_COLUMN`) — read directly from the keyed row's `id`, `name`, `externalId`, and `logoDomain`. This is the row's identity: `id` (the account PK) drives expansion, scroll, and role updates; `externalId` is the copyable group key. `getNameCell()` in `AccountsTable.tsx` is the canonical accessor. `AccountNameCell.tsx` owns the shared name, deep link, and copyable external ID presentation. The Accounts list passes `logoDomain`, which adds `AccountLogo`, and wraps the name with inline expansion behavior. Other account tables omit the logo and use normal deep-link navigation.- **relationship columns** — returned in `AccountsTableRow.relationships` as arrays of active assignee user ids keyed by definition id (`[]` when unassigned). The legacy names `csm`/`account_executive`/`account_owner` remain stored in defaults, saved views, and URL state, then translate into typed relationship columns matched by seeded definition name (`LEGACY_ROLE_COLUMNS`); a legacy column with no matching definition is dropped from the query. Other definitions are pickable from the "Relationships" column group with opaque `rel_<id>` aliases, resolved back via `aliasToRelationshipDefinition`. Cells render `RelationshipCell`: single-holder definitions get an editable `MemberSelect` (writes via the relationships assign/end endpoints — assign auto-ends the previous holder server-side); multi-holder definitions render read-only. User ids resolve to members via `membersLogic` (loaded up front in `accountsLogic.afterMount`). Sorting uses the alias directly (arrays of ids — deterministic but not email order).+### Account logos++`AccountLogo` renders the company's logo at the head of the name cell. It uses a same-sized `Lettermark` when no logo resolves.++The server selects the first valid hostname from:++1. `account.properties.website_domain`, the account's primary company website;+2. `account.properties.email_domains`, used for meeting and email attribution.++`website_domain` is a typed account property. `AccountProperties` normalizes it on write, and the Useful links editor saves it through the existing account PATCH endpoint. `parse_company_domain` accepts URLs and bare hostnames while rejecting UUIDs, free text, and mailbox providers.++`AccountsTableRow.logoDomain` carries the resolved hostname. The browser loads image bytes from `GET /api/projects/@current/accounts/icon/?domain=…&theme=…`. The action proxies logo.dev through `CDPIconsService`, which enforces per-team and instance budgets and caches misses for 24 hours. Keep logo.dev behind this proxy so the browser does not send customer domains to a third party or require another CSP origin.+The `tag_names` cell is editable in place: `TagsCell` renders the editable `ObjectTags` variant (available tags from `tagsModel`), saving through the account PATCH via `accountsLogic.updateAccountTags` — optimistic per-account override (`tagOverrides`, masking the stale fetched cell like `relationshipOverrides`), debounced full-list PATCH (`TAGS_SAVE_DEBOUNCE_MS`, since `ObjectTags` fires per added/removed tag), `savingTags` guard, revert + toast + captured exception on failure. Clicking a tag in the cell adds it to the tags filter, compounding with tags already filtered (`addTagToFilter` — dedupes, and reports through `reportFilterChange('tag')` like the filter control).Default columns: `name`, `tag_names`, `notebook_count`, plus one relationship column per team definition. `ACCOUNTS_DEFAULT_COLUMNS` is the stored-state seed name, but execution is fully typed. Once `loadRelationshipDefinitionsSuccess` fires, still-default columns upgrade to `defaultSelectColumns`. The name column is force-kept because removing it breaks identity, scroll, and role edits. `buildAccountColumnGroups` only offers typed account fields, tags, notes, relationships, and custom properties. Warehouse-backed columns, arbitrary lazy joins, and SQL expressions are unsupported. Older saved expressions are omitted from the query plan.diff --git a/products/customer_analytics/frontend/components/Accounts/AccountLogo.tsx b/products/customer_analytics/frontend/components/Accounts/AccountLogo.tsxnew file mode 100644index 000000000000..a72295d8a893--- /dev/null+++ b/products/customer_analytics/frontend/components/Accounts/AccountLogo.tsx@@ -0,0 +1,36 @@+import { useValues } from 'kea'+import { useState } from 'react'++import { Lettermark } from 'lib/lemon-ui/Lettermark'+import { hashCodeForString } from 'lib/utils/strings'++import { themeLogic } from '~/layout/navigation-3000/themeLogic'++export function accountIconUrl(domain: string, theme: 'light' | 'dark'): string {+ return `/api/projects/@current/accounts/icon/?domain=${encodeURIComponent(domain)}&theme=${theme}`+}++interface AccountLogoProps {+ domain?: string | null+ name: string+}++export function AccountLogo({ domain, name }: AccountLogoProps): JSX.Element {+ const { isDarkModeOn } = useValues(themeLogic)+ const theme = isDarkModeOn ? 'dark' : 'light'+ const iconKey = `${domain}|${theme}`+ const [failedIconKey, setFailedIconKey] = useState<string | null>(null)++ if (!domain || failedIconKey === iconKey) {+ return <Lettermark name={name} index={hashCodeForString(name)} />+ }+ return (+ <img+ src={accountIconUrl(domain, theme)}+ alt=""+ className="size-6 shrink-0 rounded-sm object-contain"+ loading="lazy"+ onError={() => setFailedIconKey(iconKey)}+ />+ )+}diff --git a/products/customer_analytics/frontend/components/Accounts/AccountNameCell.tsx b/products/customer_analytics/frontend/components/Accounts/AccountNameCell.tsxindex b318f69c6920..a46759d1eaad 100644--- a/products/customer_analytics/frontend/components/Accounts/AccountNameCell.tsx+++ b/products/customer_analytics/frontend/components/Accounts/AccountNameCell.tsx@@ -5,40 +5,53 @@ import { Link } from '@posthog/lemon-ui'import { CopyToClipboardInline } from 'lib/components/CopyToClipboard'import { urls } from 'scenes/urls'+import { AccountLogo } from './AccountLogo'+export interface AccountNameCellProps {accountId?: stringname: stringexternalId?: string | null+ logoDomain?: string | nullonClick?: MouseEventHandler<HTMLElement>target?: '_blank'}-export function AccountNameCell({ accountId, name, externalId, onClick, target }: AccountNameCellProps): JSX.Element {+export function AccountNameCell({+ accountId,+ name,+ externalId,+ logoDomain,+ onClick,+ target,+}: AccountNameCellProps): JSX.Element {return (- <div className="flex flex-col min-w-40" data-account-id={accountId}>- {accountId ? (- <Link- to={urls.customerAnalyticsAccount(accountId)}- className="font-semibold"- onClick={onClick}- target={target}- >- {name}- </Link>- ) : (- <span className="font-semibold">{name}</span>- )}- {externalId ? (- <CopyToClipboardInline- explicitValue={externalId}- iconStyle={{ color: 'var(--color-accent)' }}- iconSize="xsmall"- description="external ID"- className="text-xs text-muted"- >- {externalId}- </CopyToClipboardInline>- ) : null}+ <div className="flex items-center gap-2 min-w-40" data-account-id={accountId}>+ {logoDomain !== undefined ? <AccountLogo domain={logoDomain} name={name} /> : null}+ <div className="flex flex-col min-w-0">+ {accountId ? (+ <Link+ to={urls.customerAnalyticsAccount(accountId)}+ className="font-semibold"+ onClick={onClick}+ target={target}+ >+ {name}+ </Link>+ ) : (+ <span className="font-semibold">{name}</span>+ )}+ {externalId ? (+ <CopyToClipboardInline+ explicitValue={externalId}+ iconStyle={{ color: 'var(--color-accent)' }}+ iconSize="xsmall"+ description="external ID"+ className="text-xs text-muted"+ >+ {externalId}+ </CopyToClipboardInline>+ ) : null}+ </div></div>)}diff --git a/products/customer_analytics/frontend/components/Accounts/AccountNotebooksExpansion.tsx b/products/customer_analytics/frontend/components/Accounts/AccountNotebooksExpansion.tsxindex da140b6b604c..c002676eac10 100644--- a/products/customer_analytics/frontend/components/Accounts/AccountNotebooksExpansion.tsx+++ b/products/customer_analytics/frontend/components/Accounts/AccountNotebooksExpansion.tsx@@ -5,6 +5,7 @@ import {IconCloud,IconCopy,IconDatabase,+ IconGlobe,IconGraph,IconPencil,IconPeople,@@ -68,6 +69,7 @@ function getPreview(notebook: AccountNotebookApi): string {}const LINK_ICONS: Record<string, JSX.Element> = {+ website: <IconGlobe />,organization: <IconPeople />,revenue: <IconPiggyBank />,'usage-dashboard': <IconGraph />,diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsxindex ab2ca1d65b4f..834081babc4b 100644--- a/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx+++ b/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx@@ -23,9 +23,10 @@ const FEATURE_REQUESTS_ENDPOINT = 'api/projects/:team_id/feature_requests/'const RELATIONSHIP_DEFINITIONS_ENDPOINT = 'api/projects/:team_id/account_relationship_definitions/'const ORGANIZATION_MEMBERS_ENDPOINT = 'api/projects/:team_id/organization_members/'const WAREHOUSE_VIEW_LINK_ENDPOINT = 'api/environments/:team_id/warehouse_view_link/'+const ACCOUNT_ICON_ENDPOINT = 'api/projects/:team_id/accounts/icon/'const INSIGHTS_ENDPOINT = 'api/environments/:team_id/insights/'-type AccountNameCell = { name: string; external_id: string | null; id: string }+type AccountNameCell = { name: string; external_id: string | null; id: string; logo_domain: string | null }// Active assignee user ids from the relationships lazy join. Ids 178 and 202 match// the default org-members mock so the cells resolve to john.doe / jane.mcdoe.type AccountRelationshipCell = number[]@@ -71,6 +72,7 @@ function buildAccountsTableQueryResponse(rows: AccountRow[]): Record<string, unkid: account.id,name: account.name,externalId: account.external_id,+ logoDomain: account.logo_domain,accountFields: { name: account.name },tags,noteCount,@@ -89,13 +91,27 @@ function buildAccountsTableQueryResponse(rows: AccountRow[]): Record<string, unk}const SAMPLE_ROWS: AccountRow[] = [- [{ name: 'Acme Inc', external_id: 'cust_acme_001', id: 'acc-1' }, ['enterprise', 'priority'], 0, [178], [202], []],- [{ name: 'Globex', external_id: 'cust_globex_002', id: 'acc-2' }, [], 0, [], [], []],- [{ name: 'Hooli', external_id: null, id: 'acc-3' }, ['scaleup'], 0, [178], [], [202]],+ [+ { name: 'Acme Inc', external_id: 'cust_acme_001', id: 'acc-1', logo_domain: 'acme.example' },+ ['enterprise', 'priority'],+ 0,+ [178],+ [202],+ [],+ ],+ [{ name: 'Globex', external_id: 'cust_globex_002', id: 'acc-2', logo_domain: 'globex.example' }, [], 0, [], [], []],+ [{ name: 'Hooli', external_id: null, id: 'acc-3', logo_domain: null }, ['scaleup'], 0, [178], [], [202]],]const SINGLE_ROW: AccountRow[] = [- [{ name: 'Acme Inc', external_id: 'cust_acme_001', id: 'acc-1' }, ['enterprise', 'priority'], 1, [178], [202], []],+ [+ { name: 'Acme Inc', external_id: 'cust_acme_001', id: 'acc-1', logo_domain: 'acme.example' },+ ['enterprise', 'priority'],+ 1,+ [178],+ [202],+ [],+ ],]const ACCOUNT_WITH_LINKS = {@@ -274,6 +290,23 @@ function mockAccountsTableQuery(}}+// Storybook must not call logo.dev, and stable bytes keep visual snapshots deterministic.+const LOGO_SWATCHES: Record<string, string> = {+ 'acme.example': '#8f68d4',+ 'globex.example': '#dc9300',+}++function mockAccountIcon({ request }: MockResolverInfo): Response {+ const fill = LOGO_SWATCHES[new URL(request.url).searchParams.get('domain') ?? '']+ if (!fill) {+ return new Response(null, { status: 404 })+ }+ return new Response(+ `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect width="24" height="24" rx="4" fill="${fill}"/></svg>`,+ { headers: { 'Content-Type': 'image/svg+xml' } }+ )+}+const meta: Meta = {component: App,title: 'Scenes-App/Customer Analytics/Accounts',@@ -296,6 +329,7 @@ const meta: Meta = {get: {[WAREHOUSE_VIEW_LINK_ENDPOINT]: { count: 0, next: null, previous: null, results: [] },[RELATIONSHIP_DEFINITIONS_ENDPOINT]: RELATIONSHIP_DEFINITIONS,+ [ACCOUNT_ICON_ENDPOINT]: mockAccountIcon,},}),],diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsxindex 8ef6bf5b12be..224a365dc1fe 100644--- a/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx+++ b/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx@@ -41,10 +41,10 @@ import { accountsTableCell, isAccountsTableRow } from './accountsTableQuery'import { AccountsEvents } from './constants'// Shape the name renderer uses from the keyed AccountsTableRow identity fields.-type AccountNameCellData = { name: string; external_id: string | null; id: string }+type AccountNameCellData = { name: string; external_id: string | null; id: string; logo_domain: string | null }const COLUMN_WIDTHS = {- name: '240px',+ name: '280px',tag_names: '280px',notebook_count: '80px',relationship: '220px',@@ -60,7 +60,12 @@ function getNameCell(record: unknown): AccountNameCellData | undefined {if (!isAccountsTableRow(record)) {return undefined}- return { id: record.id, name: record.name, external_id: record.externalId ?? null }+ return {+ id: record.id,+ name: record.name,+ external_id: record.externalId ?? null,+ logo_domain: record.logoDomain ?? null,+ }}// Relationship cells carry active assignee user ids and use an empty array when unassigned.@@ -81,6 +86,7 @@ function NameCell({ record }: { record: unknown }): JSX.Element {accountId={accountId}name={cell?.name ?? ''}externalId={cell?.external_id}+ logoDomain={cell?.logo_domain}onClick={(event) => {if (!accountId || event.metaKey || event.ctrlKey || event.shiftKey) {returndiff --git a/products/customer_analytics/frontend/components/Accounts/accountLinksLogic.test.ts b/products/customer_analytics/frontend/components/Accounts/accountLinksLogic.test.tsindex 25e443f54f9e..08d99a27a0d3 100644--- a/products/customer_analytics/frontend/components/Accounts/accountLinksLogic.test.ts+++ b/products/customer_analytics/frontend/components/Accounts/accountLinksLogic.test.ts@@ -62,13 +62,17 @@ describe('accountLinksLogic', () => {it('openEditor pre-fills the form from the current account', async () => {await mountWith(- buildAccount({ external_id: 'ext-1', properties: { billing_id: 'cus_1', slack_channel_id: 'C1' } })+ buildAccount({+ external_id: 'ext-1',+ properties: { website_domain: 'acme.example', billing_id: 'cus_1', slack_channel_id: 'C1' },+ }))logic.actions.openEditor()await expectLogic(logic).toFinishAllListeners()expect(logic.values.editorOpen).toBe(true)expect(logic.values.formValues).toEqual({+ website_domain: 'acme.example',external_id: 'ext-1',billing_id: 'cus_1',slack_channel_id: 'C1',@@ -90,6 +94,7 @@ describe('accountLinksLogic', () => {logic.actions.openEditor()logic.actions.setFormValues({+ website_domain: 'acme.example',external_id: 'ext-2',billing_id: 'new',slack_channel_id: 'C9',@@ -104,6 +109,7 @@ describe('accountLinksLogic', () => {external_id: 'ext-2',properties: {hubspot_deal_id: 'deal-1',+ website_domain: 'acme.example',billing_id: 'new',slack_channel_id: 'C9',usage_dashboard_link: null,@@ -120,6 +126,7 @@ describe('accountLinksLogic', () => {mockAccountsPartialUpdate.mockResolvedValue(buildAccount())logic.actions.setFormValues({+ website_domain: '',external_id: '',billing_id: '',slack_channel_id: ' ',@@ -134,6 +141,7 @@ describe('accountLinksLogic', () => {external_id: null,properties: {billing_id: null,+ website_domain: null,slack_channel_id: null,usage_dashboard_link: null,metabase_link: null,diff --git a/products/customer_analytics/frontend/components/Accounts/accountLinksLogic.ts b/products/customer_analytics/frontend/components/Accounts/accountLinksLogic.tsindex 50b1cf42ac23..bfaec2f6c68a 100644--- a/products/customer_analytics/frontend/components/Accounts/accountLinksLogic.ts+++ b/products/customer_analytics/frontend/components/Accounts/accountLinksLogic.ts@@ -26,6 +26,7 @@ export interface AccountLinksLogicProps {}export type AccountLinkFieldKey =+ | 'website_domain'| 'external_id'| 'billing_id'| 'slack_channel_id'@@ -42,6 +43,7 @@ export interface AccountLinkFieldDef {export type AccountLinkFieldValues = Record<AccountLinkFieldKey, string>export const ACCOUNT_LINK_FIELDS: AccountLinkFieldDef[] = [+ { key: 'website_domain', label: 'Website domain', placeholder: 'example.com' },{ key: 'external_id', label: 'External ID', placeholder: 'e.g. cust_acme_001' },{ key: 'billing_id', label: 'Billing ID', placeholder: 'e.g. cus_acme_123' },{ key: 'slack_channel_id', label: 'Slack channel ID', placeholder: 'e.g. C0123456789' },@@ -51,6 +53,7 @@ export const ACCOUNT_LINK_FIELDS: AccountLinkFieldDef[] = []const EMPTY_FIELDS: AccountLinkFieldValues = {+ website_domain: '',external_id: '',billing_id: '',slack_channel_id: '',@@ -212,6 +215,7 @@ export const accountLinksLogic = kea<accountLinksLogicType>([currentFieldValues: [(s) => [s.account],(account: AccountApi | null): AccountLinkFieldValues => ({+ website_domain: account?.properties?.website_domain ?? '',external_id: account?.external_id ?? '',billing_id: account?.properties?.billing_id ?? '',slack_channel_id: account?.properties?.slack_channel_id ?? '',@@ -233,6 +237,7 @@ export const accountLinksLogic = kea<accountLinksLogicType>([searchParams: Record<string, any>}): AccountLink[] => {+ const websiteDomain = account?.properties?.website_domain ?? nullconst externalId = account?.external_id ?? nullconst billingId = account?.properties?.billing_id ?? nullconst slackChannelId = account?.properties?.slack_channel_id ?? null@@ -242,6 +247,13 @@ export const accountLinksLogic = kea<accountLinksLogicType>([const backUrl =removeProjectIdIfPresent(currentLocation.pathname) + currentLocation.search + currentLocation.hashreturn [+ {+ key: 'website',+ label: 'Website',+ to: websiteDomain ? `https://${websiteDomain}` : null,+ targetBlank: true,+ disabledReason: websiteDomain ? null : 'No website domain set',+ },{key: 'organization',label: 'Organization',@@ -318,6 +330,7 @@ export const accountLinksLogic = kea<accountLinksLogicType>([external_id: orNull(form.external_id),properties: {...current.properties,+ website_domain: orNull(form.website_domain),billing_id: orNull(form.billing_id),slack_channel_id: orNull(form.slack_channel_id),usage_dashboard_link: orNull(form.usage_dashboard_link),diff --git a/products/customer_analytics/frontend/generated/api.schemas.ts b/products/customer_analytics/frontend/generated/api.schemas.tsindex 1834c60b70a5..12816ed831a3 100644--- a/products/customer_analytics/frontend/generated/api.schemas.ts+++ b/products/customer_analytics/frontend/generated/api.schemas.ts@@ -353,10 +353,15 @@ export const SlackSummaryCadenceEnumApi = {} as const/**- * Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.+ * Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.* @nullable*/export type AccountApiProperties = {+ /**+ * Primary company website hostname used for account identity and logo lookup.+ * @nullable+ */+ website_domain?: string | null/** Email domains owned by this account's company, used to match inbound touchpoints to the account. */email_domains?: string[]/** Individual email addresses pinned to this account, matched before the domain fallback. */@@ -396,7 +401,7 @@ export interface AccountApi {*/external_id?: string | null/**- * Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.+ * Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.* @nullable*/properties?: AccountApiProperties@@ -535,10 +540,15 @@ export interface AccountRelationshipWriteApi {}/**- * Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.+ * Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.* @nullable*/export type PatchedAccountApiProperties = {+ /**+ * Primary company website hostname used for account identity and logo lookup.+ * @nullable+ */+ website_domain?: string | null/** Email domains owned by this account's company, used to match inbound touchpoints to the account. */email_domains?: string[]/** Individual email addresses pinned to this account, matched before the domain fallback. */@@ -578,7 +588,7 @@ export interface PatchedAccountApi {*/external_id?: string | null/**- * Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.+ * Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.* @nullable*/properties?: PatchedAccountApiPropertiesdiff --git a/products/customer_analytics/frontend/generated/api.zod.ts b/products/customer_analytics/frontend/generated/api.zod.tsindex 802abadb2fa7..2016a6fecf98 100644--- a/products/customer_analytics/frontend/generated/api.zod.ts+++ b/products/customer_analytics/frontend/generated/api.zod.ts@@ -198,6 +198,10 @@ export const AccountsCreateBody = /* @__PURE__ */ zod),properties: zod.object({+ website_domain: zod+ .string()+ .nullish()+ .describe('Primary company website hostname used for account identity and logo lookup.'),email_domains: zod.array(zod.string()).optional()@@ -219,7 +223,7 @@ export const AccountsCreateBody = /* @__PURE__ */ zod}).nullish().describe(- "Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here."+ "Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here."),tags: zod.array(zod.string())@@ -287,6 +291,10 @@ export const AccountsUpdateBody = /* @__PURE__ */ zod),properties: zod.object({+ website_domain: zod+ .string()+ .nullish()+ .describe('Primary company website hostname used for account identity and logo lookup.'),email_domains: zod.array(zod.string()).optional()@@ -308,7 +316,7 @@ export const AccountsUpdateBody = /* @__PURE__ */ zod}).nullish().describe(- "Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here."+ "Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here."),tags: zod.array(zod.string())@@ -352,6 +360,10 @@ export const AccountsPartialUpdateBody = /* @__PURE__ */ zod),properties: zod.object({+ website_domain: zod+ .string()+ .nullish()+ .describe('Primary company website hostname used for account identity and logo lookup.'),email_domains: zod.array(zod.string()).optional()@@ -373,7 +385,7 @@ export const AccountsPartialUpdateBody = /* @__PURE__ */ zod}).nullish().describe(- "Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here."+ "Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here."),tags: zod.array(zod.string())diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.tsindex 9c80786b0a10..f69379c62e56 100644--- a/products/dashboards/frontend/generated/api.schemas.ts+++ b/products/dashboards/frontend/generated/api.schemas.ts@@ -5360,6 +5360,8 @@ export interface AccountsTableRowApi {customPropertyHistory: AccountsTableRowApiCustomPropertyHistoryexternalId?: string | nullid: string+ /** Bare hostname the row's logo is rendered from. Null when no source resolved one. */+ logoDomain?: string | nullname: string/** Number of linked internal notes. Omitted when the request does not select the note count. */noteCount?: number | nulldiff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.tsindex e280f0692a12..64a689ea4c0c 100644--- a/products/product_analytics/frontend/generated/api.schemas.ts+++ b/products/product_analytics/frontend/generated/api.schemas.ts@@ -4522,6 +4522,8 @@ export interface AccountsTableRowApi {customPropertyHistory: AccountsTableRowApiCustomPropertyHistoryexternalId?: string | nullid: string+ /** Bare hostname the row's logo is rendered from. Null when no source resolved one. */+ logoDomain?: string | nullname: string/** Number of linked internal notes. Omitted when the request does not select the note count. */noteCount?: number | nulldiff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 7dfe65e3f646..8c54a465c9ac 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -143,10 +143,15 @@ export namespace Schemas {} as const;/**- * Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.+ * Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.* @nullable*/export type AccountProperties = {+ /**+ * Primary company website hostname used for account identity and logo lookup.+ * @nullable+ */+ website_domain?: string | null;/** Email domains owned by this account's company, used to match inbound touchpoints to the account. */email_domains?: string[];/** Individual email addresses pinned to this account, matched before the domain fallback. */@@ -200,7 +205,7 @@ export namespace Schemas {*/external_id?: string | null;/**- * Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.+ * Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.* @nullable*/properties?: AccountProperties;@@ -1325,6 +1330,8 @@ export namespace Schemas {customPropertyHistory: AccountsTableRowCustomPropertyHistory;externalId?: string | null;id: string;+ /** Bare hostname the row's logo is rendered from. Null when no source resolved one. */+ logoDomain?: string | null;name: string;/** Number of linked internal notes. Omitted when the request does not select the note count. */noteCount?: number | null;@@ -57563,10 +57570,15 @@ export namespace Schemas {}/**- * Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.+ * Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.* @nullable*/export type PatchedAccountProperties = {+ /**+ * Primary company website hostname used for account identity and logo lookup.+ * @nullable+ */+ website_domain?: string | null;/** Email domains owned by this account's company, used to match inbound touchpoints to the account. */email_domains?: string[];/** Individual email addresses pinned to this account, matched before the domain fallback. */@@ -57606,7 +57618,7 @@ export namespace Schemas {*/external_id?: string | null;/**- * Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.+ * Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.* @nullable*/properties?: PatchedAccountProperties;diff --git a/services/mcp/src/generated/customer_analytics/api.ts b/services/mcp/src/generated/customer_analytics/api.tsindex 97f35353b5ae..30c6f18e328c 100644--- a/services/mcp/src/generated/customer_analytics/api.ts+++ b/services/mcp/src/generated/customer_analytics/api.ts@@ -165,6 +165,10 @@ export const AccountsCreateBody = /* @__PURE__ */ zod),properties: zod.object({+ website_domain: zod+ .string()+ .nullish()+ .describe('Primary company website hostname used for account identity and logo lookup.'),email_domains: zod.array(zod.string()).optional()@@ -186,7 +190,7 @@ export const AccountsCreateBody = /* @__PURE__ */ zod}).nullish().describe(- "Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here."+ "Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here."),tags: zod.array(zod.string())@@ -374,6 +378,10 @@ export const AccountsPartialUpdateBody = /* @__PURE__ */ zod),properties: zod.object({+ website_domain: zod+ .string()+ .nullish()+ .describe('Primary company website hostname used for account identity and logo lookup.'),email_domains: zod.array(zod.string()).optional()@@ -395,7 +403,7 @@ export const AccountsPartialUpdateBody = /* @__PURE__ */ zod}).nullish().describe(- "Typed account properties: external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link) plus touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here."+ "Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here."),tags: zod.array(zod.string())