Prompts improved for all cards
Browse files- app/ads1/budget_optimizer.py +22 -4
- app/ads1/growth_finder.py +20 -10
- app/ads1/keyword_inspector.py +15 -22
- app/ads1/search_term_optimizer.py +20 -16
app/ads1/budget_optimizer.py
CHANGED
|
@@ -41,10 +41,28 @@ def build_budget_optimizer_prompt(context: dict) -> str:
|
|
| 41 |
name = context.get("campaign_name", "this account")
|
| 42 |
|
| 43 |
return (
|
| 44 |
-
f"
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
def run_budget_optimizer(dfs: dict, campaign_name: str | None = None) -> str:
|
| 50 |
print("\n🚀 [budget_optimizer] STARTED", flush=True)
|
|
|
|
| 41 |
name = context.get("campaign_name", "this account")
|
| 42 |
|
| 43 |
return (
|
| 44 |
+
f"""
|
| 45 |
+
You are a Google Ads budget optimizer.
|
| 46 |
+
|
| 47 |
+
TASK:
|
| 48 |
+
Identify 3–5 budget allocation actions for the campaign {name}.
|
| 49 |
+
|
| 50 |
+
STRICT RULES:
|
| 51 |
+
- Use only provided data.
|
| 52 |
+
- Do not explain categories (no "keywords/ad groups...")
|
| 53 |
+
- No repetition of headings or prompt structure.
|
| 54 |
+
- Avoid generic advice.
|
| 55 |
+
|
| 56 |
+
OUTPUT FORMAT:
|
| 57 |
+
- Action: <what to change in budget>
|
| 58 |
+
Evidence: <metrics>
|
| 59 |
+
Expected impact: <why it helps>
|
| 60 |
+
|
| 61 |
+
DATA:
|
| 62 |
+
{payload}
|
| 63 |
+
"""
|
| 64 |
+
)
|
| 65 |
+
|
| 66 |
|
| 67 |
def run_budget_optimizer(dfs: dict, campaign_name: str | None = None) -> str:
|
| 68 |
print("\n🚀 [budget_optimizer] STARTED", flush=True)
|
app/ads1/growth_finder.py
CHANGED
|
@@ -41,16 +41,26 @@ def build_growth_finder_prompt(context: dict) -> str:
|
|
| 41 |
name = context.get("campaign_name", "this account")
|
| 42 |
|
| 43 |
return (
|
| 44 |
-
f"
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
)
|
| 55 |
|
| 56 |
def run_growth_finder(dfs: dict, campaign_name: str | None = None) -> str:
|
|
|
|
| 41 |
name = context.get("campaign_name", "this account")
|
| 42 |
|
| 43 |
return (
|
| 44 |
+
f"""
|
| 45 |
+
You are a Google Ads growth strategist.
|
| 46 |
+
|
| 47 |
+
TASK:
|
| 48 |
+
Identify ONLY data-backed scaling opportunities.
|
| 49 |
+
|
| 50 |
+
STRICT RULES:
|
| 51 |
+
- If performance is weak, DO NOT suggest scaling.
|
| 52 |
+
- Do not infer missing ad groups or structures.
|
| 53 |
+
- No generic marketing theory.
|
| 54 |
+
|
| 55 |
+
OUTPUT FORMAT:
|
| 56 |
+
- Opportunity: <keyword / segment>
|
| 57 |
+
Evidence: <CTR, conversions, CPA>
|
| 58 |
+
Why it works: <short justification>
|
| 59 |
+
Action: <scale suggestion (budget / bids / match type expansion)>
|
| 60 |
+
|
| 61 |
+
DATA:
|
| 62 |
+
{payload}
|
| 63 |
+
"""
|
| 64 |
)
|
| 65 |
|
| 66 |
def run_growth_finder(dfs: dict, campaign_name: str | None = None) -> str:
|
app/ads1/keyword_inspector.py
CHANGED
|
@@ -28,32 +28,25 @@ def build_keyword_prompt(context: dict) -> str:
|
|
| 28 |
payload = json.dumps(context, indent=2, default=str)
|
| 29 |
|
| 30 |
return f"""
|
| 31 |
-
You are
|
| 32 |
|
| 33 |
-
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
-
|
| 38 |
-
-
|
| 39 |
-
- Keywords to scale
|
| 40 |
-
- Keywords to pause or reduce bids
|
| 41 |
-
- Any CTR / conversion anomalies
|
| 42 |
-
|
| 43 |
-
IMPORTANT:
|
| 44 |
-
- Do NOT assume CRM / SaaS context
|
| 45 |
-
- Assume all data relates to preschool admissions, daycare, or childcare services
|
| 46 |
-
- Think like a preschool marketing expert
|
| 47 |
-
|
| 48 |
-
DATA:
|
| 49 |
-
{payload}
|
| 50 |
-
|
| 51 |
-
Return 5 bullet points.
|
| 52 |
-
Each bullet must start with "- ".
|
| 53 |
-
Be direct, business-focused, no intro text.
|
| 54 |
-
"""
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
|
|
|
|
|
|
|
|
|
| 57 |
# -------------------------
|
| 58 |
# Main runner
|
| 59 |
# -------------------------
|
|
|
|
| 28 |
payload = json.dumps(context, indent=2, default=str)
|
| 29 |
|
| 30 |
return f"""
|
| 31 |
+
You are a Google Ads keyword performance expert for preschool campaigns.
|
| 32 |
|
| 33 |
+
TASK:
|
| 34 |
+
Classify keywords into 3–5 insights.
|
| 35 |
|
| 36 |
+
STRICT RULES:
|
| 37 |
+
- Do NOT invent ad groups or missing fields.
|
| 38 |
+
- Only use given keyword metrics.
|
| 39 |
+
- No paragraphs. Only bullet format.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
OUTPUT FORMAT:
|
| 42 |
+
- Keyword: <name>
|
| 43 |
+
Label: Winning | Wasted Spend | Scale | Reduce | Investigate
|
| 44 |
+
Evidence: <CTR, cost, conversions>
|
| 45 |
+
Action: <specific bid or pause action>
|
| 46 |
|
| 47 |
+
DATA:
|
| 48 |
+
{payload}
|
| 49 |
+
"""
|
| 50 |
# -------------------------
|
| 51 |
# Main runner
|
| 52 |
# -------------------------
|
app/ads1/search_term_optimizer.py
CHANGED
|
@@ -44,22 +44,26 @@ def build_search_optimizer_prompt(context: dict) -> str:
|
|
| 44 |
name = context.get("campaign_name", "this campaign")
|
| 45 |
|
| 46 |
return (
|
| 47 |
-
f"
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
)
|
| 64 |
|
| 65 |
# -------------------------
|
|
|
|
| 44 |
name = context.get("campaign_name", "this campaign")
|
| 45 |
|
| 46 |
return (
|
| 47 |
+
f"""
|
| 48 |
+
You are a search term optimization specialist.
|
| 49 |
+
|
| 50 |
+
TASK:
|
| 51 |
+
Return 3–5 search term actions.
|
| 52 |
+
|
| 53 |
+
STRICT RULES:
|
| 54 |
+
- Only use provided search terms.
|
| 55 |
+
- Do not compare unrelated terms.
|
| 56 |
+
- No explanations longer than 1 sentence per bullet.
|
| 57 |
+
|
| 58 |
+
OUTPUT FORMAT:
|
| 59 |
+
- Search Term: <term>
|
| 60 |
+
Category: Wasted Spend | High Intent | Scale | Negative Keyword Candidate
|
| 61 |
+
Evidence: <cost, clicks, conversions>
|
| 62 |
+
Action: <pause / scale / add as keyword / add as negative>
|
| 63 |
+
|
| 64 |
+
DATA:
|
| 65 |
+
{payload}
|
| 66 |
+
"""
|
| 67 |
)
|
| 68 |
|
| 69 |
# -------------------------
|