Email personalization in Campaign Agent

This article explains how Campaign Agent builds personalization, how it reads your project data, and how to diagnose and fix common personalization issues.

Campaign Agent personalizes email content at design time only. It builds the personalization logic — conditions, product selection, and filters — and executes that logic when the email is sent to each customer.

This means the AI never reads individual customer profiles. Only your data schema is passed to the model — field names like "purchase item ID," not actual values. No personally identifiable information (PII) reaches the model.

How Campaign Agent creates personalization

To personalize content, Campaign Agent combines three building blocks:

  • Aggregates — behavioral data derived from customer activity, such as previously purchased products, previously purchased brands, or cart contents.
  • Recommendations — output from the recommendation engine, such as bestsellers, AI recommendations, or similar items.
  • Jinja — code that filters, combines, and post-processes aggregates and recommendations into the final list of content to display.

For example, to show "bestsellers from the brand the customer previously purchased," Campaign Agent uses an aggregate (brand of previously purchased products) combined with a bestseller recommendation, then applies a Jinja filter that keeps only bestsellers whose brand matches the aggregate.

Campaign Agent also creates simpler personalization tags for individual customer attributes — such as first name or loyalty points balance — without needing the full three-building-block approach.

How Campaign Agent understands your project

Campaign Agent draws on two sources to understand your data when building personalization.

Data mapping

Data mapping is Campaign Agent's highest-trust source. Mismapped or missing mappings are the most common cause of personalization problems — they can cause Campaign Agent to build aggregates or recommendations that return no results, which triggers abort messages in preview.

Before using Campaign Agent for the first time, make sure the following mappings are in place:

  • Catalog mapped to your product catalog.
  • view_item event mapped to product ID.
  • purchase_item event mapped to product ID.

Common mapping issues that cause personalization to fail:

  • An event isn't tracked at all, but is mapped — Campaign Agent uses it and returns no results.
  • Multiple separate events track something that should be a single event with attributes (for example, separate cart-update events instead of one event with a product ID attribute).
  • A field is tracked as a string where an array is required (for example, product_ids tracked as "[\"123\"]" instead of ["123"]).
  • The catalog item ID in events doesn't match the primary ID in the catalog — this prevents Jinja from fetching catalog items by ID.

Data schema

When an attribute isn't mapped, Campaign Agent falls back to your data schema. It can use unmapped event and product attributes, but with less confidence — it only sees a sample of around 20 example values per attribute for non-PII fields.

Limited visibility into an unmapped attribute can cause personalization issues. For example, filtering recommendations on the wrong attribute returns an empty result.

When a field is marked as PII, Campaign Agent cannot inspect its example values at all. This can lead to mistakes — for example, if a child_names field is marked PII and a user asks to include children's names in the subject line, Campaign Agent has no way to verify the field's actual structure or whether it contains the expected values.

How to spot personalization issues

Campaign Agent automatically prevents broken or blank emails from being sent using abort statements — rules that stop an email from sending when personalization can't be resolved for a customer. Aborts trigger when a personalized product source is empty or malformed — for example, an empty cart, no matching recommendations, inactive products, or fewer products than the block requires. When an abort triggers for a customer, the email is not sent to that customer.

The first place you'll see personalization failing is in preview. Open the preview for a specific customer — if personalization is failing, the preview shows abort messages, often across many or most customers.

How to fix personalization issues

Step 1 — Read the abort message carefully.
It usually states exactly what's missing — for example, "couldn't find previously purchased product" or "not enough recommended products."

Campaign Agent preview panel showing a "Not enough blocks found" abort message.

Step 2 — Ask Campaign Agent to explain the block.
Use the Explain action on the block, or ask in the conversation — for example: "How exactly are previously purchased products implemented?" Verify that:

  • The right events and event attributes are used.
  • The right filters and exclusions are applied.
  • The abort rules aren't overly strict — for example, requiring exactly 6 products when "up to 6" would work.
Email block toolbar showing the Ask Loomi AI and Explain buttons.

Step 3 — Adjust conversationally.
For example: "Change the minimum number of products to 3" or "Use bestsellers instead of personalized recommendations."

Step 4 — Verify the underlying objects yourself.
Ask Campaign Agent for the IDs of the aggregate or recommendation it used, then open those objects in your project to confirm they return results for a test customer.

📘

Note

You can't inspect the generated Jinja directly. Ask Campaign Agent to explain it or change it.

Common personalization issues

The following issues are the most frequent causes of personalization problems in Campaign Agent. If you're seeing abort messages in preview, start here.

IssueWhat you seeHow to fix
Event product ID doesn't match the primary catalog IDEmpty or aborted product sourceFix data mapping, or fix tracking to use the primary catalog ID in events.
Wrong filtering attribute or logic (for example, category_level_2 instead of category_level_1, or equals "shoes" instead of contains "shoes")Empty resultAsk Campaign Agent to correct the filter.
Data type mismatch — string tracked where an array is required (for example, product_ids)Empty or aborted product sourceFix tracking to use the expected type, and tell Campaign Agent how to work with the field.
Abort rules too strict (for example, requires exactly 6 products)Abort message in previewAsk Campaign Agent to lower the minimum, use "up to N," or fall back to a different strategy — for example: "Fall back to bestsellers."

© Bloomreach, Inc. All rights reserved.