Skip to content

Generate Ads with AI

AdFuz features an intelligent AI Ad Generator powered by a Unified Asynchronous Background Queue & Real-Time Polling Engine. In just a few seconds, you can transform a single product or offer prompt into a complete advertising campaign — including copywriting, custom banner graphics, responsive HTML/CSS code, campaign schedules, ad space placements, and ready-to-use WordPress shortcodes — with zero risk of HTTP gateway timeouts.


You can open the AI Generator modal from two locations:

  1. Ads Dashboard: Click the purple ✨ Generate with AI button in the top action bar of WordPress Admin > AdFuz > Ads.
  2. Inside Ad Creation Form: Click the Generate with AI button while editing or creating an ad to automatically pre-populate form fields.

The AI Generator supports all 3 core ad classifications in AdFuz with 1-click visual selection cards:

Generates catchy headlines, persuasive marketing copy, call-to-action (CTA) button labels, and commercial banner creatives.

  • AI Copywriting: Generates title, body description (1–3 sentences), and high-CTR button text (e.g. Get 50% Off, Shop Now, Claim Deal).
  • AI Banner Image Generation: When the Generate Banner Image with AI checkbox is enabled, AdFuz generates a custom image tailored to your prompt using Google Imagen or OpenAI DALL-E 3.
  • Automatic Media Sideloading: The generated image is automatically downloaded, cropped/resized to match your chosen banner dimensions, and saved into your WordPress Media Library as an attachment.

Asynchronous Background Queue & Real-Time Polling

Section titled “Asynchronous Background Queue & Real-Time Polling”

Unlike traditional synchronous web requests that hang and timeout on slow AI calls, AdFuz utilizes a Non-Blocking Background Worker:

sequenceDiagram
autonumber
actor User as User (Browser)
participant Modal as Modal UI
participant Server as WordPress Server
participant Worker as Background Worker
participant AI as Gemini / OpenAI
User->>Modal: Clicks "Generate & Launch"
Modal->>Server: Enqueues Job
Server-->>Modal: Returns Job ID (< 300ms)
Server-)Worker: Dispatches background worker
loop Real-Time Polling (every 1.5s)
Modal->>Server: Checks Job Progress
Server-->>Modal: Step: "Writing copy..." -> "Designing graphic..." -> "Linking placement..."
Modal->>Modal: Updates Progress Bar & Stepper
end
Worker->>AI: Calls API & saves records
Worker->>Server: Marks Job Completed
Modal->>User: Renders Success Screen & Shortcode!
  • Instant Response (< 300ms): Submitting the form immediately enqueues the task in wp_adfuz_jobs.
  • Zero Timeout Risk: Heavy image resizing or model failovers run safely in the background without hitting server gateway limits (Cloudflare, Nginx, Apache).
  • Tab & Network Safe: Even if you switch browser tabs, the background worker continues running and finishes creating your ad.
  • Live Progress Stepper: The modal displays a real-time progress bar, status badges (Queued → Processing → Completed), and live step descriptions.

  1. Choose Ad Format Click on Image Ad, Script / HTML, or Video Ad. The active selection highlights with a purple border.

  2. Describe Your Product or Offer In the prompt field, describe what you are advertising.

    Example Prompt:

    “Summer Flash Sale! 50% off all premium ergonomic office chairs with code SUMMER50. Free 2-day shipping, valid until Sunday midnight.”

  3. Select Tone of Voice & Dimensions

    • Tone: Choose from Promotional (High Energy), Professional / Corporate, Urgent / Limited Time, Playful / Lifestyle, or Informative / Value-Focused.
    • Dimensions: Select your target display size (e.g., 300×250 Medium Rectangle, 728×90 Leaderboard, or 160×600 Skyscraper).
  4. Configure 1-Click Campaign & Placement (Right Panel) Automate your entire setup in a single click:

    • 1. Campaign Setup:
      • Create New Campaign: Automatically creates a new campaign named [Ad Title] Campaign and links your new ad.
      • Assign to Existing Campaign: Select any existing active campaign from the dropdown.
      • None (Save Ad only): Saves the creative in your Ads library without attaching to a campaign.
    • 2. Ad Space Placement:
      • Create New Ad Space: Automatically provisions a new ad space matching the exact width and height of your ad. You can select format as Banner, Slider, or Global.
      • Assign to Existing Space(s): Check one or more existing ad spaces to immediately add this creative to their rotation.
      • None (Skip Ad Space): Skip ad space provisioning.
    • 3. Status: Select Active (Live) ● Active for instant serving, or Draft Draft to review before publishing.
  5. Click “Generate & Launch” AdFuz enqueues the job and starts live polling. You will see real-time updates as the AI generates copy, designs graphics, and connects database placements.


Once generation finishes, the modal transitions to the Success Screen:

  • Embed Shortcode: A ready-to-use shortcode is provided (e.g. [ad-fuz ad_space_id="12"]).
  • 1-Click Copy: Click the Copy button to copy the shortcode to your clipboard.
  • Automatic Page Refresh: Closing the modal or clicking View in Ads List automatically refreshes your Ads table so your newly generated ad appears at the very top immediately.
  • Direct Actions:
    • Click Edit Ad Creative to fine-tune headlines, target URLs, or images in the visual ad builder.
    • Click View in Ads List to inspect your new ad in the table.

If image generation fails due to billing or zero quota limits, AdFuz automatically displays a dedicated resolution screen:

  1. Proceed with Copy Only (Free): 1-click button that automatically generates high-converting headlines, body descriptions, and CTA buttons for free. You can upload or select your own image from the WordPress Media Library.
  2. Switch to Script / HTML Ads: Generates styled, responsive HTML/CSS banner cards completely free using Gemini text generation.

Ad Space Insertion Guide

Learn how to embed generated shortcodes in Gutenberg, Elementor, and widgets. Insert Shortcodes →