adloop 0.38.0__tar.gz → 0.38.1__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.
- {adloop-0.38.0 → adloop-0.38.1}/PKG-INFO +1 -1
- {adloop-0.38.0 → adloop-0.38.1}/pyproject.toml +1 -1
- {adloop-0.38.0 → adloop-0.38.1}/pyproject.toml.orig +1 -1
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/assets.py +35 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/write.py +12 -1
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/rules/adloop.md +1 -1
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/server.py +3 -1
- {adloop-0.38.0 → adloop-0.38.1}/README.md +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/__init__.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/__main__.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/_mcp_patches.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/__init__.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/ai_max.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/audiences.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/brands.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/campaign_settings.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/client.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/conversion_actions.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/currency.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/custom_conversion_goals.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/enums.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/forecast.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/gaql.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/image_fetch.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/pmax.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/read.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/recommendation_subscriptions.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/recommendations.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/shopping.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/snippet_headers.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ads/validate_only.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/auth.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/cli.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/config.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/crossref.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/diagnostics.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ga4/__init__.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ga4/client.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ga4/reports.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ga4/tracking.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/ga4/write.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/gsc/__init__.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/gsc/client.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/gsc/reports.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/gtm/__init__.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/gtm/client.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/gtm/entities.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/gtm/read.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/gtm/write.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/merchant/__init__.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/merchant/client.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/merchant/read.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/pagespeed.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/reddit/__init__.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/reddit/auth.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/reddit/client.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/reddit/read.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/reddit/schedule.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/reddit/write.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/rules/__init__.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/rules/commands/analyze-performance.md +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/rules/commands/budget-plan.md +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/rules/commands/create-ad.md +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/rules/commands/create-campaign.md +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/rules/commands/diagnose-tracking.md +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/rules/commands/optimize-campaign.md +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/rules_install.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/runtime.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/safety/__init__.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/safety/approval.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/safety/approval_card.html +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/safety/audit.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/safety/guards.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/safety/preview.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/tracking.py +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/upload_card.html +0 -0
- {adloop-0.38.0 → adloop-0.38.1}/src/adloop/uploads.py +0 -0
|
@@ -320,6 +320,35 @@ def draft_business_name_asset(
|
|
|
320
320
|
return preview
|
|
321
321
|
|
|
322
322
|
|
|
323
|
+
def _account_logo_refusal(config: AdLoopConfig, customer_id: str, new_logos: int) -> str:
|
|
324
|
+
"""Why the account cannot take ``new_logos`` more business logos, or "".
|
|
325
|
+
|
|
326
|
+
Google allows one enabled account-level business logo and answers a
|
|
327
|
+
second only at the dry run, with RESOURCE_LIMIT
|
|
328
|
+
(ENABLED_FAVICON_ASSET_LINKS_PER_CUSTOMER). Say it at the draft instead,
|
|
329
|
+
with the link to remove.
|
|
330
|
+
"""
|
|
331
|
+
from adloop.ads.gaql import execute_query
|
|
332
|
+
|
|
333
|
+
if not new_logos:
|
|
334
|
+
return ""
|
|
335
|
+
if new_logos > 1:
|
|
336
|
+
return f"Google allows one business logo per account; this draft links {new_logos}."
|
|
337
|
+
rows = execute_query(config, customer_id, (
|
|
338
|
+
"SELECT asset.id, asset.name FROM customer_asset "
|
|
339
|
+
"WHERE customer_asset.field_type = 'BUSINESS_LOGO' AND customer_asset.status = 'ENABLED'"))
|
|
340
|
+
if not rows:
|
|
341
|
+
return ""
|
|
342
|
+
asset_id = rows[0].get("asset.id")
|
|
343
|
+
name = rows[0].get("asset.name")
|
|
344
|
+
current = f"asset {asset_id} '{name}'" if name else f"asset {asset_id}"
|
|
345
|
+
return (
|
|
346
|
+
f"The account already has a business logo ({current}), and Google allows one per "
|
|
347
|
+
"account. To replace it, remove its account link first with remove_entity("
|
|
348
|
+
f'entity_type="customer_asset", entity_id="{asset_id}~BUSINESS_LOGO"), then draft again.'
|
|
349
|
+
)
|
|
350
|
+
|
|
351
|
+
|
|
323
352
|
def link_asset_to_customer(
|
|
324
353
|
config: AdLoopConfig,
|
|
325
354
|
*,
|
|
@@ -376,6 +405,12 @@ def link_asset_to_customer(
|
|
|
376
405
|
)
|
|
377
406
|
elif row.get("asset.name"):
|
|
378
407
|
link["asset_name"] = row["asset.name"]
|
|
408
|
+
if not errors:
|
|
409
|
+
refusal = _account_logo_refusal(
|
|
410
|
+
config, customer_id, sum(link["field_type"] == "BUSINESS_LOGO" for link in validated)
|
|
411
|
+
)
|
|
412
|
+
if refusal:
|
|
413
|
+
errors.append(refusal)
|
|
379
414
|
if errors:
|
|
380
415
|
return {"error": "Validation failed", "details": errors}
|
|
381
416
|
|
|
@@ -2605,7 +2605,12 @@ def draft_image_assets(
|
|
|
2605
2605
|
explicit (``scope="account"``) and takes BUSINESS_LOGO only, named in
|
|
2606
2606
|
``field_types``: one entry per image, in the order uploads, paths, URLs.
|
|
2607
2607
|
"""
|
|
2608
|
-
from adloop.ads.assets import
|
|
2608
|
+
from adloop.ads.assets import (
|
|
2609
|
+
_account_logo_refusal,
|
|
2610
|
+
_account_scope_warning,
|
|
2611
|
+
resolve_scope,
|
|
2612
|
+
scope_entity,
|
|
2613
|
+
)
|
|
2609
2614
|
from adloop.runtime import deployment_mode
|
|
2610
2615
|
from adloop.safety.guards import SafetyViolation, check_blocked_operation
|
|
2611
2616
|
from adloop.safety.preview import ChangePlan, store_plan
|
|
@@ -2634,6 +2639,12 @@ def draft_image_assets(
|
|
|
2634
2639
|
errors.extend(image_errors)
|
|
2635
2640
|
if not errors:
|
|
2636
2641
|
errors.extend(_assign_image_field_types(validated_images, scope, field_types))
|
|
2642
|
+
if not errors and scope == "account":
|
|
2643
|
+
refusal = _account_logo_refusal(
|
|
2644
|
+
config, customer_id, sum(image["field_type"] == "BUSINESS_LOGO" for image in validated_images)
|
|
2645
|
+
)
|
|
2646
|
+
if refusal:
|
|
2647
|
+
errors.append(refusal)
|
|
2637
2648
|
if errors:
|
|
2638
2649
|
return {"error": "Validation failed", "details": errors}
|
|
2639
2650
|
|
|
@@ -299,7 +299,7 @@ Conversions that happen offline (a sales call, a lead that turned into a deal) g
|
|
|
299
299
|
| `draft_promotion` | Create a promotion asset ("20% off winter tyres") for an ad group, a campaign or the account | `promotion_target` (≤20), `final_url`, `language_code` (REQUIRED), `money_off` or `percent_off`; optional `promotion_code` (≤15) or `orders_over_amount`, `occasion`, `discount_modifier` UP_TO, dates, `ad_schedule` (hours it shows); amounts in the account currency unless `currency_code` |
|
|
300
300
|
| `update_promotion` | Edit a promotion IN PLACE; fields not passed stay | `asset_id` plus the fields to change; `money_off`/`percent_off` and `promotion_code`/`orders_over_amount` replace each other; `ad_schedule` replaces its schedule; `clear_fields` removes optional ones (incl. `ad_schedule`) |
|
|
301
301
|
| `draft_price_asset` | Create a price asset (3-8 offerings) for an ad group, a campaign or the account | `offerings` [{header ≤25, description ≤25, price, final_url, unit}], `price_type`, `language_code` (both REQUIRED); `price_qualifier` FROM/UP_TO/AVERAGE optional; account currency unless `currency_code` |
|
|
302
|
-
| `draft_image_assets` | Create image assets for a campaign from local files, public image URLs or uploads (does NOT publish); a business logo can also go on the account | `campaign_id` or `scope="account"`, `field_types` (one per image: AD_IMAGE, the campaign default, or BUSINESS_LOGO; account level takes BUSINESS_LOGO only), `image_paths` (local PNG/JPEG/GIF files; not on a hosted server), `image_urls` (public http(s) image links, ≤5120 KB; re-checked at apply — if the image changed since the preview, draft again) and/or `upload_ids` (`up_...` from `upload_images` / `list_uploads`) |
|
|
302
|
+
| `draft_image_assets` | Create image assets for a campaign from local files, public image URLs or uploads (does NOT publish); a business logo can also go on the account | `campaign_id` or `scope="account"`, `field_types` (one per image: AD_IMAGE, the campaign default, or BUSINESS_LOGO; account level takes BUSINESS_LOGO only, one per account: to replace it, remove the current link with `remove_entity` first; the draft names it), `image_paths` (local PNG/JPEG/GIF files; not on a hosted server), `image_urls` (public http(s) image links, ≤5120 KB; re-checked at apply — if the image changed since the preview, draft again) and/or `upload_ids` (`up_...` from `upload_images` / `list_uploads`) |
|
|
303
303
|
| `draft_sitelinks` | Create sitelink extensions for a campaign or the account (does NOT publish) | `campaign_id` or `scope="account"`, `sitelinks` list of {link_text ≤25 chars, final_url, description1 ≤35 chars, description2 ≤35 chars} |
|
|
304
304
|
| `draft_keywords` | Propose keyword additions (does NOT add) | Each keyword needs `text` and `match_type` (EXACT/PHRASE/BROAD) |
|
|
305
305
|
| `add_negative_keywords` | Propose negative keywords directly on a campaign (does NOT add) | `campaign_id`, keyword list, `match_type` |
|
|
@@ -5055,7 +5055,9 @@ def draft_image_assets(
|
|
|
5055
5055
|
no public URL.
|
|
5056
5056
|
scope: Empty follows campaign_id. "account" links the images
|
|
5057
5057
|
account-wide, which Google allows for BUSINESS_LOGO only and which
|
|
5058
|
-
is never inferred from an empty campaign_id.
|
|
5058
|
+
is never inferred from an empty campaign_id. An account takes one
|
|
5059
|
+
business logo: while one is linked, the draft is refused and
|
|
5060
|
+
names the link to remove first.
|
|
5059
5061
|
field_types: One per image, in the order upload_ids, image_paths,
|
|
5060
5062
|
image_urls: AD_IMAGE (campaign links; the default) or BUSINESS_LOGO
|
|
5061
5063
|
(campaign or account links). Required with scope="account".
|
|
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
|
|
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
|
|
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
|
|
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
|