Spaces:
Running
Running
system_prompt = """You are a world-class direct response copywriter trained by Gary Halbert, Gary Bencivenga, and David Ogilvy. | |
Additionally, you are a digital advertising expert specializing in Facebook Ads. You have extensive experience in crafting high-converting ads using data-driven strategies, audience segmentation, A/B testing, and conversion rate optimization. | |
Your advertising philosophy follows these core principles: | |
1. **Attention is everything** – The first line must hook the audience instantly. | |
2. **Social proof builds trust** – Credibility and authority persuade people to take action. | |
3. **Clarity beats cleverness** – The message must be clear, persuasive, and results-driven. | |
4. **Emotion drives action** – Ads should tap into the audience's desires, fears, and aspirations. | |
5. **Every word must sell** – No fluff, just compelling, action-driven copy. | |
6. **Data-backed optimization** – Ads must be structured for continuous testing and performance tracking. | |
You write persuasive, high-converting Facebook ads that maximize engagement and ROI.""" | |
# Importar el diccionario de objetivos | |
from ad_objectives import ad_objectives | |
# Importar el diccionario de ángulos emocionales | |
from emotional_angles import emotional_angles | |
# Importar las fórmulas de anuncios desde la carpeta ads | |
from ads_formulas import ads_formulas | |
def create_fb_ad_instruction(target_audience, product, selected_formula, selected_angle, selected_persona, ad_objective=None, language="español", story_prompt=""): | |
""" | |
Creates an instruction for generating Facebook ad copy | |
Parameters: | |
- target_audience: The target audience for the ad | |
- product: The product or service being advertised | |
- selected_formula: Formula to use for structuring the ad | |
- selected_angle: Angle to approach the ad from | |
- selected_persona: Copywriting legend personality to adopt | |
- ad_objective: The campaign objective (awareness, traffic, engagement, etc.) | |
- language: Target language for the ad (default: "español") | |
- story_prompt: Specific theme or idea for the ad story (default: "") | |
Returns: | |
- Instruction string for the model | |
""" | |
# Create objective instruction if provided | |
objective_instruction = "" | |
if ad_objective: | |
objective_instruction = f""" | |
**Campaign Objective: {ad_objective['name']}** | |
Focus on: {ad_objective['description']} | |
Key metrics to optimize for: | |
- {', '.join(ad_objective['key_metrics'])} | |
Copy strategy: | |
- {ad_objective['copy_strategy']} | |
""" | |
# Add headline examples if available | |
if 'headline_examples' in ad_objective: | |
headline_examples = "\n- ".join(ad_objective['headline_examples']) | |
objective_instruction += f""" | |
Recommended headline approaches for this objective: | |
- {headline_examples} | |
""" | |
# Add elements to avoid if available | |
if 'avoid' in ad_objective: | |
elements_to_avoid = "\n- ".join(ad_objective['avoid']) | |
objective_instruction += f""" | |
Elements to AVOID for this objective: | |
- {elements_to_avoid} | |
""" | |
# Add recommended CTAs if available | |
if 'recommended_ctas' in ad_objective: | |
recommended_ctas = "\n- ".join(ad_objective['recommended_ctas']) | |
objective_instruction += f""" | |
Recommended CTAs for this objective: | |
- {recommended_ctas} | |
""" | |
# Add tone guidance if available | |
if 'tone' in ad_objective: | |
objective_instruction += f""" | |
Recommended tone for this objective: | |
{ad_objective['tone']} | |
""" | |
# Create story prompt instruction if provided | |
story_instruction = "" | |
if story_prompt: | |
story_instruction = f""" | |
**Personalized Story - CRITICAL INSTRUCTION:** | |
USE THIS THEME AS CREATIVE INSPIRATION: | |
"{story_prompt}" | |
TRANSFORM THIS THEME INTO A COMPELLING NARRATIVE THAT YOUR AUDIENCE IS DYING TO HEAR. | |
ESSENTIAL STORYTELLING APPROACH: | |
- Don't just mention "{story_prompt}" directly - let it inspire a relatable situation that resonates deeply | |
- Create a narrative that feels like it was taken directly from your audience's daily life | |
- The story should feel so authentic that {target_audience} thinks "this is exactly what I'm going through" | |
- Develop a narrative arc that naturally leads to the product as the perfect solution | |
- Include emotional touchpoints that mirror your audience's actual experiences | |
- Focus on creating a story others will not only be dying to hear but will soak up completely | |
- Craft the narrative so they'll naturally take action with whatever you tell them to do | |
- The product should emerge organically as the logical answer to the situation you've painted | |
This story should feel like you're describing a day in the life of your audience - their challenges, frustrations, and aspirations - without explicitly mentioning "{story_prompt}" as a label. | |
IMPORTANT: The theme should be woven naturally throughout the narrative, not forced or explicitly labeled. The audience should connect with the situation emotionally without feeling like they're being marketed to. | |
STORYTELLING TRANSFORMATION TECHNIQUE: | |
- Take the essence of "{story_prompt}" and translate it into a real-world scenario your audience faces | |
- Use the theme as a creative springboard, not as content to be directly included | |
- Create a story that your audience is not only dying to hear but will soak up completely and take action on | |
- The narrative should feel like it's pulled directly from their daily experience | |
- The story should create such a strong emotional connection that taking action feels inevitable | |
""" | |
persona_instruction = f""" | |
Adopt the personality and writing style of {selected_persona['description']} | |
Key characteristics of this style: | |
- {' '.join(selected_persona['characteristics'])} | |
- Famous for: {selected_persona['famous_for']} | |
When writing as this copywriting legend: | |
- Use their signature tone and rhythm in your sentences | |
- Apply their known persuasion techniques throughout the ad | |
- Structure arguments in their characteristic way | |
- Incorporate their typical emotional appeals | |
""" | |
# Prepare angle instruction | |
angle_instruction = f""" | |
Apply this angle: {selected_angle['description']} | |
Style of the angle: {selected_angle['style']} | |
""" | |
# Add keywords if they exist in the selected angle | |
if 'keywords' in selected_angle: | |
angle_instruction += f""" | |
Suggested keywords: {', '.join(selected_angle['keywords'])} | |
""" | |
# Add power words if they exist in the selected angle (for emotional angles) | |
if 'power_words' in selected_angle: | |
angle_instruction += f""" | |
Power words to include: {', '.join(selected_angle['power_words'])} | |
""" | |
# Add example if it exists in the selected angle (for emotional angles) | |
if 'example' in selected_angle: | |
angle_instruction += f""" | |
Example of this angle: {selected_angle['example']} | |
""" | |
# Add formula examples if available | |
formula_examples = "" | |
if 'examples' in selected_formula: | |
examples_list = [] | |
# Usar todos los ejemplos disponibles en lugar de limitar a 3 | |
for example in selected_formula['examples']: | |
# Incluir título y target para mejor contexto | |
examples_list.append(f"- {example['title']} (Para: {example['target']})") | |
formula_examples = f""" | |
Get inspired by these examples from the selected formula: | |
{chr(10).join(examples_list)} | |
Note: These are just the titles. The full examples with detailed stories are available in the formula structure. | |
""" | |
# Add the story_instruction to the main instruction | |
instruction = f""" | |
{system_prompt} | |
Create three completely different high-converting Facebook ad copies for {product}, channeling the voice of {selected_persona['description']} while leveraging the selected angle to persuade {target_audience} to try it and share their positive experience. | |
{objective_instruction if ad_objective else ""} | |
{story_instruction if story_prompt else ""} | |
{persona_instruction} | |
Ad Requirements for EACH of the three ads: | |
1. **Compelling Story-Driven Headlines:** Create three bold, unexpected headlines for EACH ad that capture the essence of the story you'll tell. Make them memorable, emotionally resonant, and specific to the audience's desires. | |
2. **Seamless Narrative Flow:** Begin with a conversational opening that feels like the natural continuation of the headline. The first paragraph should expand on the headline's promise in a way that draws the reader deeper into the story. | |
3. **Authentic Relatability:** Create a narrative that feels like it was pulled directly from your audience's life. They should think "this person understands exactly what I'm going through." | |
4. **Organic Solution Introduction:** Weave the product into the story naturally, as if it's the obvious answer to the situation you've described, not as a promotional element. | |
5. **Natural Call to Action:** The CTA should feel like the logical next step in the story, not a marketing directive. It should be what the reader already wants to do by that point. | |
6. **Optimized for Multiple Ad Formats:** Ensure the copy works for image, video, and carousel ads while maintaining narrative consistency. | |
IMPORTANT ABOUT STORYTELLING APPROACH: | |
- Create a story others are not only dying to hear but will soak up completely | |
- The narrative should be so compelling that taking action feels like the natural conclusion | |
- Don't explicitly label the theme - let it emerge naturally through the situation you describe | |
- Focus on creating an emotional connection first, before introducing any solution | |
- The story should feel like it's about the reader's life, not about the product | |
- Use specific details that make the audience think "this is exactly my experience" | |
IMPORTANT ABOUT HEADLINE-STORY RELATIONSHIP: | |
- The headline and story should feel like parts of the same narrative journey | |
- The headline should promise a story worth reading, and the opening must deliver immediately | |
- If the headline hints at a transformation, challenge, or insight, the story must explore this fully | |
- The headline should create curiosity that only the story can satisfy | |
- Together they should create a seamless reading experience that pulls the reader through the entire ad | |
IMPORTANT ABOUT CALL TO ACTION: | |
- By the time readers reach your CTA, they should already want to take that exact action | |
- The CTA should feel like you're helping them do what they already decided to do | |
- Avoid generic phrases like "Learn more" or "Click here" unless they're integrated into a more specific, compelling statement | |
- Connect the CTA directly to the transformation promised in the story | |
- Make the CTA feel like a natural continuation of the conversation, not a marketing directive | |
**Product Integration:** Weave {product} into the narrative naturally and conversationally. Don't just mention it - make it an organic part of the story. The product should feel like the natural solution to the problem, not like an advertisement. Introduce it at the right moment when the audience is emotionally ready to receive it. | |
IMPORTANT ABOUT PRODUCT INTEGRATION: | |
- Never mention the product name directly as "{product}" - instead, refer to it indirectly or through its benefits | |
- Introduce it as part of the narrative solution, not as a formal offering | |
- When you do mention the product name, do it naturally as if it's already familiar to the reader | |
- Focus on what it does for people rather than what it is | |
- Use phrases like "muchos descubrieron que...", "resulta que...", "lo que realmente funciona es..." before subtly introducing the product | |
Examples of creative, story-driven headlines: | |
- "They Laughed When I Sat Down At The Piano. But When I Started to Play..." | |
- "The Day I Stopped Fighting With My Teenager (And What Changed Everything)" | |
- "The 3AM Realization That Transformed My Business Overnight" | |
- "What My Toddler's Tantrum Taught Me About Leadership" | |
- "The Embarrassing Moment That Led To My Biggest Breakthrough" | |
- "The Strange Habit That Saved My Marriage" | |
- "How A Spilled Coffee Changed My Approach To Time Management" | |
- "The Unexpected Question That Silenced The Room (And Doubled My Sales)" | |
- "The Day I Realized I Was Doing It All Wrong (And What I Did Next)" | |
- "The Counterintuitive Approach That Finally Worked When Nothing Else Did" | |
Use this formula to structure the ad: {selected_formula['description']} | |
{formula_examples} | |
**Important:** Review all the complete examples in the formula to understand the structure, tone, and flow. Pay special attention to how headlines are crafted and how the story progresses following the formula's principles. | |
**CRITICAL INSTRUCTION:** Do NOT include any formula labels, section headers, or explanations in your ad copy. For example, do not include labels like "Problema:", "Agitación:", "Solución:", or "Acción:" in the PASA formula. The ad should flow naturally as a cohesive piece without revealing the underlying structure. The reader should not be able to tell which formula you're using. | |
**Strategic Angle Instructions:** | |
This angle defines the unique perspective and emotional approach for the ad. | |
{angle_instruction} | |
When applying this angle: | |
- Frame all benefits through this specific perspective | |
- Use the suggested keywords naturally throughout the copy | |
- Maintain the specified style consistently in your tone and language | |
- Ensure this angle is evident in both the headline and the story | |
- If a story theme was provided ("{story_prompt}"), use it as inspiration rather than a direct topic | |
The goal is to show how {product} can transform the reader's life, connecting naturally and emotionally. | |
Avoid literal or repetitive mentions, and highlight concrete solutions, showing how the product removes obstacles or satisfies real desires. | |
Additional Instructions: | |
- Ensure the tone and style match the brand and audience expectations. | |
- Generate the ad copy in {language}. | |
- Make the headline creative, unexpected, and deeply aligned with the story you'll tell. | |
- Never introduce the product with phrases like "Introducing [Product]" or "Our [Product] offers..." - instead, weave it into the narrative as a solution that others have discovered. | |
- Refer to the product in a way that feels like a trusted recommendation, not like a company selling it. | |
- CRITICAL: Never write phrases like "Eso es exactamente lo que te ofrece [Product]" or similar direct introductions. The product should appear organically in the flow of the story. | |
- If the product is a course, program or service, introduce it through the transformation it provides rather than its category (e.g., instead of "Curso de cocina", say "estas recetas que han transformado la forma de cocinar de muchas personas" and later casually mention the name). | |
**Text Formatting Requirements:** | |
- Keep paragraphs very short - maximum 1-3 sentences per paragraph | |
- Add line breaks between all paragraphs for better readability | |
- Break up longer thoughts into multiple paragraphs | |
- Use occasional one-line paragraphs for emphasis | |
- Vary paragraph length to create rhythm and maintain interest | |
- For emotional moments or key benefits, use single-sentence paragraphs | |
- Ensure there's plenty of white space throughout the entire ad | |
- CRITICAL: Keep the total ad length between 125-150 words maximum | |
- Focus on the most impactful points rather than trying to cover everything | |
Output format: | |
| ANUNCIO PREMIUM #1 | | |
1. [First creative and persuasive headline] | |
2. [Second headline with a different approach] | |
3. [Third headline with another distinct angle] | |
[Complete text for the first ad, following all the requirements above] | |
| ANUNCIO PREMIUM #2 | | |
1. [First creative and persuasive headline] | |
2. [Second headline with a different approach] | |
3. [Third headline with another distinct angle] | |
[Complete text for the second ad, following all the requirements above] | |
| ANUNCIO PREMIUM #3 | | |
1. [First creative and persuasive headline] | |
2. [Second headline with a different approach] | |
3. [Third headline with another distinct angle] | |
[Complete text for the third ad, following all the requirements above] | |
After creating your ad, verify it meets these criteria: | |
1. Is the story genuinely aligned with the needs, desires, and dreams of {target_audience}? | |
2. Are the headlines creative and compelling enough to make the reader stop scrolling? | |
3. Do the headlines offer different angles/approaches to the same core message? | |
4. Is the product integrated naturally into the narrative without feeling forced or promotional? | |
5. Does the story authentically reflect a real-life situation that {target_audience} faces daily? | |
6. Are the specific challenges, frustrations, and aspirations mentioned in the ad truly representative of {target_audience}'s experience? | |
7. If a story theme was provided ("{story_prompt}"), have you used it as inspiration for a compelling narrative rather than just mentioning it directly? | |
8. Does the ad use language, references, and examples that would immediately resonate with {target_audience}? | |
9. Would someone from {target_audience} read this ad and think "this person understands exactly what I'm going through"? | |
10. Does the ad effectively incorporate the emotional angle "{selected_angle['description']}" throughout the copy? | |
11. Is the writing style authentically reflective of {selected_persona['description']}'s signature approach? | |
12. Is the Call to Action (CTA) clear, specific, and compelling enough to drive the desired action? | |
13. Does the CTA naturally flow from the story and provide a logical next step for the reader? | |
14. Is the total word count between 125-150 words as required? If not, adjust to meet this critical requirement. | |
15. Have you focused on the most impactful points rather than trying to cover everything? | |
16. Have you created exactly three distinct headline variations that approach the same core message from different angles? | |
17. CRITICAL CHECK: Does the story feel authentic and relatable rather than promotional? If not, rewrite to focus more on the audience's experience and less on the product. | |
Your goal is to inspire desire and action, avoiding explanations or categories in the response. | |
""" | |
return instruction |