adloop 0.43.0__tar.gz → 0.44.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. {adloop-0.43.0 → adloop-0.44.0}/PKG-INFO +1 -1
  2. {adloop-0.43.0 → adloop-0.44.0}/pyproject.toml +1 -1
  3. {adloop-0.43.0 → adloop-0.44.0}/pyproject.toml.orig +1 -1
  4. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/audiences.py +3 -2
  5. adloop-0.44.0/src/adloop/ga4/audiences.py +456 -0
  6. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/write.py +5 -2
  7. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/rules/adloop.md +4 -1
  8. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/server.py +96 -1
  9. {adloop-0.43.0 → adloop-0.44.0}/README.md +0 -0
  10. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/__init__.py +0 -0
  11. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/__main__.py +0 -0
  12. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/_mcp_patches.py +0 -0
  13. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/__init__.py +0 -0
  14. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/ai_max.py +0 -0
  15. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/assets.py +0 -0
  16. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/brands.py +0 -0
  17. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/campaign_settings.py +0 -0
  18. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/client.py +0 -0
  19. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/conversion_actions.py +0 -0
  20. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/currency.py +0 -0
  21. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/custom_conversion_goals.py +0 -0
  22. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/enums.py +0 -0
  23. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/forecast.py +0 -0
  24. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/gaql.py +0 -0
  25. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/image_fetch.py +0 -0
  26. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/pmax.py +0 -0
  27. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/read.py +0 -0
  28. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/recommendation_subscriptions.py +0 -0
  29. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/recommendations.py +0 -0
  30. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/shopping.py +0 -0
  31. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/snippet_headers.py +0 -0
  32. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/validate_only.py +0 -0
  33. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ads/write.py +0 -0
  34. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/auth.py +0 -0
  35. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/cli.py +0 -0
  36. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/config.py +0 -0
  37. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/conversion_setup.py +0 -0
  38. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/crossref.py +0 -0
  39. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/diagnostics.py +0 -0
  40. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/__init__.py +0 -0
  41. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/admin.py +0 -0
  42. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/annotations.py +0 -0
  43. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/attribution.py +0 -0
  44. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/audit.py +0 -0
  45. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/client.py +0 -0
  46. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/definitions.py +0 -0
  47. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/funnels.py +0 -0
  48. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/reports.py +0 -0
  49. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/retention.py +0 -0
  50. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/suggest.py +0 -0
  51. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/ga4/tracking.py +0 -0
  52. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/gsc/__init__.py +0 -0
  53. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/gsc/client.py +0 -0
  54. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/gsc/reports.py +0 -0
  55. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/gtm/__init__.py +0 -0
  56. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/gtm/client.py +0 -0
  57. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/gtm/entities.py +0 -0
  58. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/gtm/read.py +0 -0
  59. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/gtm/write.py +0 -0
  60. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/merchant/__init__.py +0 -0
  61. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/merchant/client.py +0 -0
  62. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/merchant/read.py +0 -0
  63. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/__init__.py +0 -0
  64. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/auth.py +0 -0
  65. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/client.py +0 -0
  66. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/manage/__init__.py +0 -0
  67. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/manage/_common.py +0 -0
  68. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/manage/ad_groups.py +0 -0
  69. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/manage/ads.py +0 -0
  70. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/manage/campaigns.py +0 -0
  71. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/manage/extensions.py +0 -0
  72. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/manage/negatives.py +0 -0
  73. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/manage/removal.py +0 -0
  74. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/manage/targeting.py +0 -0
  75. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/read.py +0 -0
  76. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/microsoft_ads/write.py +0 -0
  77. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/oauth_redirect.py +0 -0
  78. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/pagespeed.py +0 -0
  79. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/reddit/__init__.py +0 -0
  80. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/reddit/auth.py +0 -0
  81. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/reddit/client.py +0 -0
  82. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/reddit/read.py +0 -0
  83. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/reddit/schedule.py +0 -0
  84. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/reddit/write.py +0 -0
  85. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/rules/__init__.py +0 -0
  86. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/rules/commands/analyze-performance.md +0 -0
  87. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/rules/commands/budget-plan.md +0 -0
  88. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/rules/commands/create-ad.md +0 -0
  89. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/rules/commands/create-campaign.md +0 -0
  90. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/rules/commands/diagnose-tracking.md +0 -0
  91. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/rules/commands/optimize-campaign.md +0 -0
  92. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/rules_install.py +0 -0
  93. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/runtime.py +0 -0
  94. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/safety/__init__.py +0 -0
  95. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/safety/approval.py +0 -0
  96. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/safety/approval_card.html +0 -0
  97. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/safety/audit.py +0 -0
  98. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/safety/guards.py +0 -0
  99. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/safety/outcomes.py +0 -0
  100. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/safety/preview.py +0 -0
  101. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/tracking.py +0 -0
  102. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/upload_card.html +0 -0
  103. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/uploads.py +0 -0
  104. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/views/__init__.py +0 -0
  105. {adloop-0.43.0 → adloop-0.44.0}/src/adloop/views/performance.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: adloop
3
- Version: 0.43.0
3
+ Version: 0.44.0
4
4
  Summary: Google Ads MCP server for Claude, ChatGPT and Cursor, with Reddit Ads, GA4 and Tag Manager. Every change is previewed first.
5
5
  Keywords: mcp,mcp-server,google-ads,google-ads-mcp,reddit-ads,google-analytics,ga4,claude,chatgpt,cursor,marketing
6
6
  Author: Daniel Klose
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "adloop"
3
- version = "0.43.0"
3
+ version = "0.44.0"
4
4
  description = "Google Ads MCP server for Claude, ChatGPT and Cursor, with Reddit Ads, GA4 and Tag Manager. Every change is previewed first."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "adloop"
3
- version = "0.43.0"
3
+ version = "0.44.0"
4
4
  description = "Google Ads MCP server for Claude, ChatGPT and Cursor, with Reddit Ads, GA4 and Tag Manager. Every change is previewed first."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -51,8 +51,9 @@ _KIND_LABELS = {
51
51
  "custom_audience": "custom segments",
52
52
  "combined_audience": "combined segments",
53
53
  }
54
- # Search shows ads to a remarketing list once it has this many active users.
55
- _SEARCH_MIN_SIZE = 1000
54
+ # Google serves a remarketing list from 100 active users in the last 30 days,
55
+ # on Search as on Display and YouTube.
56
+ _SEARCH_MIN_SIZE = 100
56
57
  _MAX_PER_DRAFT = 50
57
58
 
58
59
 
@@ -0,0 +1,456 @@
1
+ """GA4 audiences: list them, create, rename or archive one.
2
+
3
+ An audience is a group of users defined by what they did (the events they
4
+ sent). GA4 shares its audiences with every linked Google Ads account that
5
+ allows personalized advertising, where they show up as remarketing lists
6
+ (get_audience_lists) and can be attached to campaigns
7
+ (draft_audience_attachment). That makes a GA4 audience the way to build a
8
+ remarketing list without another tag on the site.
9
+
10
+ The API is v1alpha; its errors come back as a plain message. GA4 fixes an
11
+ audience's conditions and membership duration at creation: only the name
12
+ and description can change afterwards, and archiving is permanent.
13
+ """
14
+
15
+ from __future__ import annotations
16
+
17
+ import re
18
+ from typing import TYPE_CHECKING
19
+
20
+ if TYPE_CHECKING:
21
+ from adloop.config import AdLoopConfig
22
+
23
+ # Per-property limits (GA4 help: "Create, edit, and archive audiences").
24
+ LIMITS = {"standard": 100, "360": 400}
25
+ MAX_MEMBERSHIP_DAYS = 540
26
+ # Google Ads serves a list from 100 active users in the last 30 days.
27
+ ADS_MIN_ACTIVE_USERS = 100
28
+ _EVENT = re.compile(r"^[A-Za-z][A-Za-z0-9_]{0,39}$")
29
+ _ACTIONS = ("create", "update", "archive")
30
+ _SCOPE = "AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS"
31
+ OPERATIONS = {action: f"ga4_{action}_audience" for action in _ACTIONS}
32
+
33
+
34
+ def _enum(value) -> str:
35
+ return getattr(value, "name", "") or str(value or "")
36
+
37
+
38
+ def _clause_events(clause) -> list[str] | None:
39
+ """Event names of a clause this module could have written, else None.
40
+
41
+ The shape is one AND group of one OR group of plain event filters.
42
+ Anything else (sequences, parameter or dimension filters) is an
43
+ audience built elsewhere, reported as ``custom_conditions``.
44
+ """
45
+ simple = getattr(clause, "simple_filter", None)
46
+ expression = getattr(simple, "filter_expression", None)
47
+ groups = list(getattr(getattr(expression, "and_group", None), "filter_expressions", None) or [])
48
+ if len(groups) != 1:
49
+ return None
50
+ events = []
51
+ for item in list(getattr(getattr(groups[0], "or_group", None), "filter_expressions", None) or []):
52
+ event = getattr(item, "event_filter", None)
53
+ name = getattr(event, "event_name", "")
54
+ if not name or getattr(getattr(event, "event_parameter_filter_expression", None), "and_group", None):
55
+ return None
56
+ events.append(name)
57
+ return events or None
58
+
59
+
60
+ def audience_entry(audience) -> dict:
61
+ entry = {
62
+ "audience": audience.name,
63
+ "display_name": audience.display_name,
64
+ "description": audience.description,
65
+ "membership_duration_days": int(audience.membership_duration_days or 0),
66
+ "ads_personalization_enabled": bool(audience.ads_personalization_enabled),
67
+ }
68
+ include: list[str] = []
69
+ exclude: list[str] = []
70
+ custom = False
71
+ for clause in audience.filter_clauses or []:
72
+ events = _clause_events(clause)
73
+ if events is None:
74
+ custom = True
75
+ elif _enum(clause.clause_type) == "EXCLUDE":
76
+ exclude += events
77
+ else:
78
+ # Clauses are AND'ed; this module only ever writes one include clause.
79
+ custom = custom or bool(include)
80
+ include += events
81
+ if custom:
82
+ # Built in GA4's own editor with conditions this module does not write.
83
+ entry["custom_conditions"] = True
84
+ try:
85
+ entry["conditions"] = [type(c).to_dict(c, use_integers_for_enums=False) for c in audience.filter_clauses]
86
+ except Exception: # noqa: BLE001 - only there to show what the audience matches
87
+ pass
88
+ else:
89
+ entry["include_events"] = include
90
+ if exclude:
91
+ entry["exclude_events"] = exclude
92
+ entry["exclude_permanently"] = _enum(audience.exclusion_duration_mode) == "EXCLUDE_PERMANENTLY"
93
+ return entry
94
+
95
+
96
+ def _read(config: AdLoopConfig, pid: str) -> list[dict]:
97
+ from adloop.ga4.client import get_admin_alpha_client
98
+
99
+ return [audience_entry(a) for a in get_admin_alpha_client(config).list_audiences(parent=f"properties/{pid}")]
100
+
101
+
102
+ def ads_readiness(config: AdLoopConfig, pid: str) -> list[dict]:
103
+ """What decides whether this property's audiences reach Google Ads.
104
+
105
+ Each check is ``{"check", "status" (ok / warn / info), "detail"}``. A
106
+ setting that cannot be read is reported as info, never as a pass.
107
+ """
108
+ from adloop.ga4.client import get_admin_alpha_client, get_admin_client
109
+
110
+ checks: list[dict] = []
111
+
112
+ def add(check: str, status: str, detail: str) -> None:
113
+ checks.append({"check": check, "status": status, "detail": detail})
114
+
115
+ try:
116
+ links = list(get_admin_client(config).list_google_ads_links(parent=f"properties/{pid}"))
117
+ except Exception as e: # noqa: BLE001
118
+ links = None
119
+ add("google_ads_link", "info", f"The Google Ads links could not be read: {str(e)[:160]}")
120
+ if links == []:
121
+ add("google_ads_link", "warn",
122
+ "No Google Ads account is linked to this property, so its audiences reach no ad account "
123
+ "(draft_conversion_tracking_setup links one).")
124
+ elif links:
125
+ on = [link.customer_id for link in links if link.ads_personalization_enabled is not False]
126
+ off = [link.customer_id for link in links if link.ads_personalization_enabled is False]
127
+ if on:
128
+ add("google_ads_link", "ok", f"Audiences are shared with Google Ads {', '.join(on)}.")
129
+ if off:
130
+ add("ads_personalization", "warn",
131
+ f"The link to Google Ads {', '.join(off)} has personalized advertising switched off, so that "
132
+ "account receives no audiences. Switch it on in GA4 under Admin > Product links > Google Ads links.")
133
+
134
+ try:
135
+ signals = get_admin_alpha_client(config).get_google_signals_settings(
136
+ name=f"properties/{pid}/googleSignalsSettings")
137
+ state = _enum(signals.state)
138
+ except Exception as e: # noqa: BLE001 - v1alpha
139
+ state = ""
140
+ add("google_signals", "info", f"The Google signals setting could not be read: {str(e)[:160]}")
141
+ if state == "GOOGLE_SIGNALS_ENABLED":
142
+ add("google_signals", "ok", "Google signals are on.")
143
+ elif state == "GOOGLE_SIGNALS_DISABLED":
144
+ add("google_signals", "warn",
145
+ "Google signals are off. For remarketing GA4 needs Google signals or user-provided data collection "
146
+ "switched on (Admin > Data collection); whether user-provided data is on cannot be read here.")
147
+
148
+ add("consent", "info",
149
+ "Visitors only join an audience used for ads when they allowed it: a site with a consent banner has to "
150
+ "pass that choice to Google (consent mode), otherwise the list stays small or empty.")
151
+ add("list_size", "info",
152
+ f"Google Ads serves a list from {ADS_MIN_ACTIVE_USERS} active users in the last 30 days. A new audience "
153
+ "appears in Google Ads within about two days; get_audience_lists shows its size there.")
154
+ return checks
155
+
156
+
157
+ def list_ga4_audiences(config: AdLoopConfig, *, property_id: str = "") -> dict:
158
+ """The property's audiences, the slots left and whether they reach Google Ads."""
159
+ from adloop.ga4.admin import check_property, service_level
160
+
161
+ pid, error = check_property(property_id)
162
+ if error:
163
+ return {"error": error}
164
+ audiences = _read(config, pid)
165
+ level = service_level(config, pid)
166
+ readiness = ads_readiness(config, pid)
167
+ return {
168
+ "property": f"properties/{pid}",
169
+ "service_level": level,
170
+ "audiences": sorted(audiences, key=lambda a: a["display_name"].lower()),
171
+ "usage": {"used": len(audiences), "limit": LIMITS[level]},
172
+ "google_ads_readiness": readiness,
173
+ "insights": [c["detail"] for c in readiness if c["status"] == "warn"],
174
+ }
175
+
176
+
177
+ def _events(label: str, values: list[str] | None, errors: list[str]) -> list[str]:
178
+ names = list(dict.fromkeys(str(v).strip() for v in values or [] if str(v).strip()))
179
+ for name in names:
180
+ if not _EVENT.match(name):
181
+ errors.append(
182
+ f"{label} '{name}' is not a GA4 event name (a letter first, then letters, digits and "
183
+ "underscores, at most 40 characters)"
184
+ )
185
+ return names
186
+
187
+
188
+ def _find(audiences: list[dict], audience: str) -> list[dict]:
189
+ wanted = audience.strip()
190
+ by_resource = [a for a in audiences if a["audience"] == wanted or a["audience"].rsplit("/", 1)[-1] == wanted]
191
+ return by_resource or [a for a in audiences if a["display_name"] == wanted]
192
+
193
+
194
+ def _editable(entry: dict) -> dict:
195
+ return {"display_name": entry["display_name"], "description": entry["description"]}
196
+
197
+
198
+ def _generated_description(include: list[str], exclude: list[str], days: int) -> str:
199
+ text = f"Users who sent {' or '.join(include)}"
200
+ if exclude:
201
+ text += f", without {' or '.join(exclude)}"
202
+ return f"{text}; {days} days."
203
+
204
+
205
+ def draft_ga4_audience(
206
+ config: AdLoopConfig,
207
+ *,
208
+ property_id: str = "",
209
+ action: str = "create",
210
+ display_name: str = "",
211
+ description: str | None = None,
212
+ include_events: list[str] | None = None,
213
+ exclude_events: list[str] | None = None,
214
+ membership_duration_days: int = 30,
215
+ exclude_permanently: bool = False,
216
+ audience: str = "",
217
+ ) -> dict:
218
+ """Draft creating, renaming or archiving a GA4 audience: returns a PREVIEW."""
219
+ from adloop.ga4.admin import check_property, fingerprint, service_level
220
+ from adloop.safety.guards import SafetyViolation, check_blocked_operation
221
+ from adloop.safety.preview import ChangePlan, store_plan
222
+
223
+ action = (action or "").strip().lower()
224
+ if action not in _ACTIONS:
225
+ return {"error": f"action must be one of {', '.join(_ACTIONS)}"}
226
+ operation = OPERATIONS[action]
227
+ try:
228
+ check_blocked_operation(operation, config.safety)
229
+ except SafetyViolation as e:
230
+ return {"error": str(e)}
231
+
232
+ pid, error = check_property(property_id)
233
+ errors = [error] if error else []
234
+ display_name = (display_name or "").strip()
235
+ audience = (audience or "").strip()
236
+ if description is not None:
237
+ description = description.strip()
238
+ include = _events("include_events:", include_events, errors)
239
+ exclude = _events("exclude_events:", exclude_events, errors)
240
+
241
+ if action == "create":
242
+ if not display_name:
243
+ errors.append("display_name is required")
244
+ if not include:
245
+ errors.append(
246
+ "include_events is required: the events that put a user in the audience, e.g. "
247
+ "['session_start'] for every visitor or ['purchase'] for buyers"
248
+ )
249
+ overlap = sorted(set(include) & set(exclude))
250
+ if overlap:
251
+ errors.append(f"{', '.join(overlap)} cannot be both included and excluded")
252
+ try:
253
+ days = int(membership_duration_days)
254
+ except (TypeError, ValueError):
255
+ days = 0
256
+ if not 1 <= days <= MAX_MEMBERSHIP_DAYS:
257
+ errors.append(f"membership_duration_days must be between 1 and {MAX_MEMBERSHIP_DAYS}")
258
+ if exclude_permanently and not exclude:
259
+ errors.append("exclude_permanently needs exclude_events")
260
+ elif not audience:
261
+ errors.append(f"name the audience to {action}: its display name or its resource name (list_ga4_audiences)")
262
+ if errors:
263
+ return {"error": "Validation failed", "details": errors}
264
+
265
+ audiences = _read(config, pid)
266
+ warnings: list[str] = []
267
+
268
+ if action == "create":
269
+ if any(a["display_name"] == display_name for a in audiences):
270
+ return {"error": f"An audience called '{display_name}' already exists; pick a different display_name."}
271
+ level = service_level(config, pid)
272
+ limit = LIMITS[level]
273
+ if len(audiences) >= limit:
274
+ return {"error": f"All {limit} audience slots of this {level} property are used. Archive one first "
275
+ "(list_ga4_audiences shows them)."}
276
+ changes = {
277
+ "property_id": pid,
278
+ "display_name": display_name,
279
+ "description": description or _generated_description(include, exclude, days),
280
+ "include_events": include,
281
+ "membership_duration_days": days,
282
+ }
283
+ if exclude:
284
+ changes["exclude_events"] = exclude
285
+ changes["exclude_permanently"] = bool(exclude_permanently)
286
+ warnings += [
287
+ "The events and the membership duration cannot be changed after creation; only the name and "
288
+ "description can. A wrong audience has to be archived and created again.",
289
+ "GA4 fills it from now on, and adds users who met the conditions in the last 30 days for its use "
290
+ "in Google Ads. It takes one to two days to appear in a linked Google Ads account.",
291
+ ]
292
+ if exclude and exclude_permanently:
293
+ warnings.append(
294
+ f"Users who ever sent {' or '.join(exclude)} are kept out for good, also after they stop."
295
+ )
296
+ warnings += [c["detail"] for c in ads_readiness(config, pid) if c["status"] == "warn" or c["check"] == "consent"]
297
+ plan = ChangePlan(operation=operation, entity_type="ga4_audience", entity_id=display_name, changes=changes)
298
+ else:
299
+ matches = _find(audiences, audience)
300
+ if not matches:
301
+ return {"error": "No audience matches.",
302
+ "audiences": [{"audience": a["audience"], "display_name": a["display_name"]} for a in audiences[:50]]}
303
+ if len(matches) > 1:
304
+ return {"error": f"More than one audience is called '{audience}'; pass the resource name.",
305
+ "matches": matches}
306
+ current = matches[0]
307
+ before = _editable(current)
308
+ changes = {"property_id": pid, "audience": current["audience"], "fingerprint": fingerprint(before)}
309
+ if action == "archive":
310
+ changes["display_name"] = current["display_name"]
311
+ plan = ChangePlan(operation=operation, entity_type="ga4_audience", entity_id=current["display_name"],
312
+ changes=changes, requires_double_confirm=True)
313
+ warnings.append(
314
+ f"Archiving removes '{current['display_name']}' for good: it cannot be restored, and Google Ads "
315
+ "campaigns that use the list lose it. Check get_audience_targeting on the campaigns first."
316
+ )
317
+ else:
318
+ after = dict(before)
319
+ if display_name:
320
+ if display_name != before["display_name"] and any(a["display_name"] == display_name for a in audiences):
321
+ return {"error": f"An audience called '{display_name}' already exists."}
322
+ after["display_name"] = display_name
323
+ if description is not None:
324
+ if not description:
325
+ return {"error": "GA4 requires a description; it cannot be emptied."}
326
+ after["description"] = description
327
+ if include or exclude:
328
+ return {"error": "GA4 fixes an audience's events at creation. Only display_name and description "
329
+ "can change; archive the audience and create a new one for other events."}
330
+ changed = [k for k in after if after[k] != before[k]]
331
+ if not changed:
332
+ return {"status": "NO_CHANGE", "message": f"The audience '{current['display_name']}' already has these values.",
333
+ "audience": current}
334
+ for field in changed:
335
+ changes[field] = after[field]
336
+ changes[f"current_{field}"] = before[field]
337
+ changes["after"] = after
338
+ plan = ChangePlan(operation=operation, entity_type="ga4_audience", entity_id=current["display_name"],
339
+ changes=changes)
340
+
341
+ plan.platform = "ga4"
342
+ store_plan(plan)
343
+ preview = plan.to_preview()
344
+ if warnings:
345
+ preview["warnings"] = warnings
346
+ return preview
347
+
348
+
349
+ def _check_unchanged(config: AdLoopConfig, changes: dict) -> dict:
350
+ from adloop.ga4.admin import fingerprint
351
+ from adloop.ga4.client import get_admin_alpha_client
352
+
353
+ current = audience_entry(get_admin_alpha_client(config).get_audience(name=changes["audience"]))
354
+ if fingerprint(_editable(current)) != changes["fingerprint"]:
355
+ raise RuntimeError(
356
+ f"The audience '{current['display_name']}' was changed in GA4 after the preview; draft the change again."
357
+ )
358
+ return current
359
+
360
+
361
+ def preflight(config: AdLoopConfig, plan) -> dict:
362
+ """Dry run: re-check the name and the limit (create) or that nothing changed (update, archive)."""
363
+ from adloop.ga4.admin import service_level
364
+
365
+ changes = plan.changes
366
+ if plan.operation != OPERATIONS["create"]:
367
+ _check_unchanged(config, changes)
368
+ return {"audience_unchanged": True}
369
+ audiences = _read(config, changes["property_id"])
370
+ if any(a["display_name"] == changes["display_name"] for a in audiences):
371
+ raise RuntimeError(f"An audience called '{changes['display_name']}' was created in the meantime.")
372
+ limit = LIMITS[service_level(config, changes["property_id"])]
373
+ if len(audiences) >= limit:
374
+ raise RuntimeError(f"All {limit} audience slots are used now.")
375
+ return {"slots_left_after_apply": limit - len(audiences) - 1}
376
+
377
+
378
+ def _clause(types, clause_type: str, events: list[str]):
379
+ """One clause: users who sent any of ``events``, at any time.
380
+
381
+ GA4 wants an AND group at the top that holds OR groups, and event
382
+ filters only inside an OR group.
383
+ """
384
+ return types.AudienceFilterClause(
385
+ clause_type=types.AudienceFilterClause.AudienceClauseType[clause_type],
386
+ simple_filter=types.AudienceSimpleFilter(
387
+ scope=types.AudienceFilterScope[_SCOPE],
388
+ filter_expression=types.AudienceFilterExpression(
389
+ and_group=types.AudienceFilterExpressionList(filter_expressions=[
390
+ types.AudienceFilterExpression(or_group=types.AudienceFilterExpressionList(filter_expressions=[
391
+ types.AudienceFilterExpression(event_filter=types.AudienceEventFilter(event_name=name))
392
+ for name in events
393
+ ]))
394
+ ])
395
+ ),
396
+ ),
397
+ )
398
+
399
+
400
+ def build_audience(changes: dict):
401
+ """The Audience message for a create plan."""
402
+ from google.analytics.admin_v1alpha import types
403
+
404
+ clauses = [_clause(types, "INCLUDE", changes["include_events"])]
405
+ kwargs = {}
406
+ if changes.get("exclude_events"):
407
+ clauses.append(_clause(types, "EXCLUDE", changes["exclude_events"]))
408
+ mode = "EXCLUDE_PERMANENTLY" if changes.get("exclude_permanently") else "EXCLUDE_TEMPORARILY"
409
+ kwargs["exclusion_duration_mode"] = types.Audience.AudienceExclusionDurationMode[mode]
410
+ return types.Audience(
411
+ display_name=changes["display_name"],
412
+ description=changes["description"],
413
+ membership_duration_days=changes["membership_duration_days"],
414
+ filter_clauses=clauses,
415
+ **kwargs,
416
+ )
417
+
418
+
419
+ def _apply_create(config: AdLoopConfig, changes: dict) -> dict:
420
+ from adloop.ga4.client import get_admin_alpha_client
421
+
422
+ created = get_admin_alpha_client(config).create_audience(
423
+ parent=f"properties/{changes['property_id']}", audience=build_audience(changes))
424
+ return {"resource_names": [created.name], **audience_entry(created)}
425
+
426
+
427
+ def _apply_update(config: AdLoopConfig, changes: dict) -> dict:
428
+ from google.analytics.admin_v1alpha import types
429
+ from google.protobuf import field_mask_pb2
430
+
431
+ from adloop.ga4.client import get_admin_alpha_client
432
+
433
+ current = _check_unchanged(config, changes)
434
+ after, before = changes["after"], _editable(current)
435
+ paths = [k for k in after if after[k] != before[k]]
436
+ updated = get_admin_alpha_client(config).update_audience(
437
+ audience=types.Audience(name=changes["audience"], display_name=after["display_name"],
438
+ description=after["description"]),
439
+ update_mask=field_mask_pb2.FieldMask(paths=paths),
440
+ )
441
+ return {"resource_names": [updated.name], **audience_entry(updated)}
442
+
443
+
444
+ def _apply_archive(config: AdLoopConfig, changes: dict) -> dict:
445
+ from adloop.ga4.client import get_admin_alpha_client
446
+
447
+ _check_unchanged(config, changes)
448
+ get_admin_alpha_client(config).archive_audience(name=changes["audience"])
449
+ return {"resource_names": [changes["audience"]], "display_name": changes["display_name"], "archived": True}
450
+
451
+
452
+ APPLIERS = {
453
+ OPERATIONS["create"]: _apply_create,
454
+ OPERATIONS["update"]: _apply_update,
455
+ OPERATIONS["archive"]: _apply_archive,
456
+ }
@@ -315,8 +315,10 @@ def preflight(config: AdLoopConfig, plan) -> dict | None:
315
315
  fail, or would act on something that changed since the preview. Nothing
316
316
  is changed.
317
317
  """
318
- from adloop.ga4 import annotations, definitions, retention
318
+ from adloop.ga4 import annotations, audiences, definitions, retention
319
319
 
320
+ if plan.operation in audiences.APPLIERS:
321
+ return audiences.preflight(config, plan)
320
322
  if plan.operation in retention.APPLIERS:
321
323
  return retention.preflight(config, plan)
322
324
  if plan.operation in annotations.APPLIERS:
@@ -373,13 +375,14 @@ def _apply_delete_key_event(config: AdLoopConfig, changes: dict) -> dict:
373
375
 
374
376
 
375
377
  def _all_appliers() -> dict:
376
- from adloop.ga4 import annotations, definitions, retention
378
+ from adloop.ga4 import annotations, audiences, definitions, retention
377
379
 
378
380
  return {
379
381
  "create_key_event": _apply_create_key_event,
380
382
  "ga4_update_key_event": _apply_update_key_event,
381
383
  "delete_key_event": _apply_delete_key_event,
382
384
  **annotations.APPLIERS,
385
+ **audiences.APPLIERS,
383
386
  **definitions.APPLIERS,
384
387
  **retention.APPLIERS,
385
388
  }
@@ -32,6 +32,7 @@ You have access to AdLoop MCP tools that connect Google Ads, Reddit Ads and Goog
32
32
  | `run_ga4_funnel` | "Where do users drop off?": users per step, completion and abandonment, the biggest drop | `steps` (2-10 event names or `{"page": "/checkout"}` / `{"event": ..., "directly_followed": true, "within_minutes": 30}`), dates, `open_funnel`, `breakdown` (a dimension), `next_action` (eventName or pagePath), `dimension_filter` |
33
33
  | `run_ga4_attribution` | "Which channel gets the credit?": conversions, revenue, ad cost, ROAS by channel, campaign or source under DATA_DRIVEN or LAST_CLICK; `COMPARE` shows both and the shift in credit | `dimensions` (defaultChannelGroup, campaignName, source, ...), `metrics`, dates, `conversions` (key event names), `attribution_model` |
34
34
  | `list_ga4_annotations` | The notes on GA4's charts: "what happened on that day?" | optional date range |
35
+ | `list_ga4_audiences` | The property's audiences, the slots left, and `google_ads_readiness`: whether they reach Google Ads as remarketing lists (link, personalized advertising, Google signals) | `property_id` |
35
36
  | `list_ga4_custom_definitions` | Custom dimensions and metrics with their parameters, and the slots left before the limit | `property_id` |
36
37
  | `get_tracking_events` | Understanding what events are configured and their volume | `date_range_start`, `date_range_end` |
37
38
  | `list_key_events` | Which events count as key events (conversions), their counting method, and whether GA4 lets them be deleted | `property_id` (falls back to config) |
@@ -99,7 +100,7 @@ You have access to AdLoop MCP tools that connect Google Ads, Reddit Ads and Goog
99
100
  - PMax tools: `get_pmax_performance` returns `insights[]` flagging weak ad strength and zero-conversion asset groups. `segments.ad_network_type` includes MIXED — a Google catch-all for most PMax traffic. Full channel splits (Search vs YouTube vs Display vs Discover) are not available via the API.
100
101
  - `get_pmax_assets` returns `by_status` and `by_field_type` summaries. Note: per-asset performance labels (BEST/GOOD/LOW) are not available for PMax assets in the Google Ads API. Use `get_detailed_asset_performance` for quality signals via top combinations.
101
102
  - `get_audience_performance` works for campaigns with explicit audience targeting. PMax audience targeting is automatic and may not appear in this report. When the results include SEARCH campaigns, `insights[]` reminds you that custom segments cannot be attached to them (see the compatibility matrix below) — relay that constraint instead of proposing impossible pairings.
102
- - `get_audience_lists` flags lists below 1,000 users (Search ignores them until they grow) and closed lists. `get_audience_targeting`'s `audience_mode` is the entity's AUDIENCE setting: `observation` means the audiences only adjust bids and report, `targeting` means the ads only reach them, `not set` means none was written yet.
103
+ - `get_audience_lists` flags lists below 100 active users (Google does not serve them until they grow) and closed lists. `get_audience_targeting`'s `audience_mode` is the entity's AUDIENCE setting: `observation` means the audiences only adjust bids and report, `targeting` means the ads only reach them, `not set` means none was written yet.
103
104
  - `get_demographic_targeting` returns an empty list when no demographics have been excluded or narrowed — that is the DEFAULT state (Google serves to all segments). Each criterion includes a composite `remove_id` (`adGroupId~criterionId` or `campaignId~criterionId`) that can be passed straight to `remove_entity`.
104
105
  - **Compact mode for audits**: `get_campaign_performance`, `get_keyword_performance`, `get_search_terms`, and `get_ad_performance` accept `compact=true`, returning account totals, breakdowns, the top-10 rows, and pre-computed offender lists (zero-conversion spenders, budget-limited converters, low-QS keywords, negative-keyword waste candidates, thin RSAs, single-ad ad groups, disapproved or limited ads) instead of every row; compact `get_ad_performance` keeps `final_urls` on its rows and adds `landing_pages` (every final URL across all ads with its ad count), so landing-page checks need no extra GAQL — roughly 90% smaller. Use it for account audits and overviews so raw tables don't flood the context; use the default full mode when you need a specific entity's exact rows before drafting a change. In harnesses with subagents, heavy multi-tool audits can additionally be delegated to a subagent that returns only the summary.
105
106
 
@@ -114,10 +115,12 @@ Same draft → preview → `confirm_and_apply` gate as Google Ads. The GA4 Admin
114
115
  | `draft_ga4_annotation` | Create, change or delete an annotation (a note on a date or range in GA4's charts). Google's own annotations cannot be changed | `action` (create/update/delete), `title` (≤60), `date` (+ `end_date` for a range), `description` (≤150), `color`, `annotation` (ID for update/delete) |
115
116
  | `draft_ga4_custom_dimension` | Register an event parameter, user property or item parameter as a dimension; rename or archive one (archive cannot be undone) | `action` (create/update/archive), `parameter_name`, `scope` (EVENT/USER/ITEM), `display_name`, `description` |
116
117
  | `draft_ga4_custom_metric` | Register a numeric event parameter as a metric; change or archive one | `action`, `parameter_name`, `display_name`, `measurement_unit` (STANDARD, CURRENCY, ...), `restricted_metric_type` (required for CURRENCY) |
118
+ | `draft_ga4_audience` | Create an audience from events (visitors, buyers, visitors who did not buy); rename or archive one. Linked Google Ads accounts receive it as a remarketing list | `action`, `display_name`, `include_events`, `exclude_events`, `membership_duration_days` (1-540), `exclude_permanently`, `audience` (for update/archive) |
117
119
  | `draft_ga4_data_retention` | Change how long GA4 keeps event- and user-level data (default 2 months; standard properties allow 14, GA4 360 up to 50). Shortening deletes older data and needs a double confirmation | `event_data_retention` / `user_data_retention` (months: 2, 14, 26, 38, 50), `reset_user_data_on_new_activity` |
118
120
 
119
121
  - A new custom dimension or metric is filled only from now on: events sent before stay without it, and data can take a day or two to show. Say so before the user approves. `parameter_name` and scope cannot change later, so check the spelling against the code that sends the parameter.
120
122
  - Check `list_ga4_custom_definitions` before creating: the draft refuses a full property, a duplicate parameter and a taken display name, but the user should hear about the limit before asking.
123
+ - **Remarketing lists come from GA4 audiences.** To retarget site visitors: `list_ga4_audiences` first (GA4 creates "All Users" and "Purchasers" by default, so the list may exist already, and `google_ads_readiness` says whether audiences reach Google Ads at all), then `draft_ga4_audience` for what is missing, then after one to two days `get_audience_lists` in Google Ads and `draft_audience_attachment` on the campaign. On Search this needs no display ads: attach the list as observation to bid on past visitors, or exclude buyers. Tell the user before they approve: an audience's events and duration cannot be edited later, a list serves only from 100 active users in 30 days (a small site may never get there), and visitors who declined the consent banner never join. Advertisers in sensitive categories (health, finances, and similar) may not use their own audiences for ads at all.
121
124
  - Key events feed Google Ads. Before removing one, or changing how it counts, check with `check_key_event_imports` whether Google Ads imports it: that conversion action changes with it.
122
125
  - Data retention only limits explorations, funnels and other user-level reports; standard reports are not affected. Longer retention helps from now on only. Before the user approves, remind them that a privacy policy naming a retention period must match the new one.
123
126
 
@@ -1502,6 +1502,36 @@ def list_ga4_annotations(
1502
1502
  )
1503
1503
 
1504
1504
 
1505
+ @_tool(title="List Analytics audiences", annotations=_READONLY, tags={"ga4"})
1506
+ @_safe
1507
+ def list_ga4_audiences(property_id: str = "") -> dict:
1508
+ """List a GA4 property's audiences and check whether they reach Google Ads.
1509
+
1510
+ GA4 shares its audiences with every linked Google Ads account that
1511
+ allows personalized advertising; there they are remarketing lists
1512
+ (get_audience_lists) that draft_audience_attachment puts on a campaign.
1513
+ Returns each audience's resource name, display name, description,
1514
+ membership duration and the events that include or exclude users
1515
+ (audiences built with other conditions in GA4's editor carry
1516
+ custom_conditions and the raw conditions), the audience slots used
1517
+ against the limit (100, or 400 on a 360 property), and
1518
+ google_ads_readiness: checks for the Google Ads link, personalized
1519
+ advertising on it, Google signals, consent and list size, each with a
1520
+ status (ok, warn or info). insights repeats the warnings. Reads the GA4
1521
+ Admin API (audiences.list, googleAdsLinks.list, googleSignalsSettings).
1522
+
1523
+ Args:
1524
+ property_id: GA4 property as "properties/123456789" or the bare
1525
+ numeric ID. If empty, uses the default from config.
1526
+ """
1527
+ from adloop.ga4.audiences import list_ga4_audiences as _impl
1528
+
1529
+ return _impl(
1530
+ current_config(),
1531
+ property_id=property_id or current_config().ga4.property_id,
1532
+ )
1533
+
1534
+
1505
1535
  @_tool(title="List Analytics custom definitions", annotations=_READONLY, tags={"ga4"})
1506
1536
  @_safe
1507
1537
  def list_ga4_custom_definitions(property_id: str = "") -> dict:
@@ -3467,7 +3497,7 @@ def get_audience_lists(customer_id: str = "") -> dict:
3467
3497
  Each user list comes with its type, membership status (OPEN or CLOSED),
3468
3498
  size for Search and Display, eligibility and membership duration;
3469
3499
  custom and combined segments with their id and description. Insights
3470
- flag lists below the 1,000 users Search needs and closed lists. Use the
3500
+ flag lists below the 100 active users Search needs and closed lists. Use the
3471
3501
  ids with draft_audience_attachment; for Google's in-market and affinity
3472
3502
  segments use search_audience_segments.
3473
3503
 
@@ -8450,6 +8480,71 @@ def draft_ga4_annotation(
8450
8480
  )
8451
8481
 
8452
8482
 
8483
+ @_tool(title="Draft an Analytics audience", annotations=_DESTRUCTIVE, tags={"ga4"})
8484
+ @_safe
8485
+ def draft_ga4_audience(
8486
+ action: str = "create",
8487
+ display_name: str = "",
8488
+ include_events: _StrList = [], # noqa: B006
8489
+ exclude_events: _StrList = [], # noqa: B006
8490
+ membership_duration_days: int = 30,
8491
+ exclude_permanently: bool = False,
8492
+ description: str | None = None,
8493
+ audience: str = "",
8494
+ property_id: str = "",
8495
+ ) -> dict:
8496
+ """Draft creating, renaming or archiving a GA4 audience — returns a PREVIEW.
8497
+
8498
+ An audience is the users who sent certain events. A linked Google Ads
8499
+ account receives it as a remarketing list within one to two days, to
8500
+ attach to campaigns with draft_audience_attachment: this is how to
8501
+ build a list of site visitors, of buyers, or of visitors who did not
8502
+ buy. GA4 fixes the events and the membership duration at creation;
8503
+ afterwards only the name and description can change, and archiving is
8504
+ permanent (it needs a double confirmation). The draft refuses a taken
8505
+ name and a full property, and the preview warns when the property's
8506
+ audiences would not reach Google Ads (see list_ga4_audiences). Nothing
8507
+ changes until confirm_and_apply applies the plan_id.
8508
+
8509
+ Args:
8510
+ action: "create" (default), "update" (name and description only) or
8511
+ "archive".
8512
+ display_name: Name of the audience; required for create, the new
8513
+ name for update.
8514
+ include_events: Create only. Users who sent ANY of these events
8515
+ join, e.g. ["session_start"] for every visitor, ["purchase"]
8516
+ for buyers, ["sign_up", "generate_lead"] for leads.
8517
+ exclude_events: Create only. Users who sent any of these are kept
8518
+ out, e.g. include ["session_start"] and exclude ["purchase"]
8519
+ for visitors who did not buy.
8520
+ membership_duration_days: Create only. Days a user stays after
8521
+ last meeting the conditions, 1 to 540 (default 30).
8522
+ exclude_permanently: Create only. True keeps users out for good
8523
+ once they sent an excluded event; False (default) only while
8524
+ they keep meeting the exclusion within the membership window.
8525
+ description: Optional for create (one is written from the events);
8526
+ the new description for update.
8527
+ audience: For update and archive: the audience's display name or
8528
+ resource name from list_ga4_audiences.
8529
+ property_id: GA4 property as "properties/123456789" or the bare
8530
+ numeric ID. If empty, uses the default from config.
8531
+ """
8532
+ from adloop.ga4.audiences import draft_ga4_audience as _impl
8533
+
8534
+ return _impl(
8535
+ current_config(),
8536
+ property_id=property_id or current_config().ga4.property_id,
8537
+ action=action,
8538
+ display_name=display_name,
8539
+ description=description,
8540
+ include_events=include_events,
8541
+ exclude_events=exclude_events,
8542
+ membership_duration_days=membership_duration_days,
8543
+ exclude_permanently=exclude_permanently,
8544
+ audience=audience,
8545
+ )
8546
+
8547
+
8453
8548
  @_tool(title="Draft an Analytics custom dimension", annotations=_DESTRUCTIVE, tags={"ga4"})
8454
8549
  @_safe
8455
8550
  def draft_ga4_custom_dimension(
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes