# dfaimetagen — Bulk AI Generator for Meta Titles, Descriptions & ALT

> Overview dfaimetagen bulk-generates your meta titles, meta descriptions and image ALT tags with AI (Anthropic Claude, OpenAI GPT or Mistral) on PrestaShop 8 and 9. The module covers 6 entity…

- Page: <https://www.datafirefly.com/en/documentation/dfaimetagen/>
- Language: en
- Last updated: 2026-07-01
- Other languages: [fr](https://www.datafirefly.com/documentation/dfaimetagen/index.md), [es](https://www.datafirefly.com/es/documentation/dfaimetagen/index.md), [de](https://www.datafirefly.com/de/documentation/dfaimetagen/index.md), [it](https://www.datafirefly.com/it/documentation/dfaimetagen/index.md), [pl](https://www.datafirefly.com/pl/documentation/dfaimetagen/index.md), [pt](https://www.datafirefly.com/pt/documentation/dfaimetagen/index.md), [nl](https://www.datafirefly.com/nl/documentation/dfaimetagen/index.md)
- Index: <https://www.datafirefly.com/en/documentation/llms.txt>

## Overview

dfaimetagen bulk-generates your meta titles, meta descriptions and image ALT tags with AI (Anthropic Claude, OpenAI GPT or Mistral) on PrestaShop 8 and 9. The module covers 6 entity types (products, categories, CMS pages, manufacturers, suppliers, product images), applies proven CTR patterns, produces A/B variants, enforces SERP length limits and rejects duplicates through Jaccard similarity.

## Requirements

- PrestaShop 8.0 to 9.x
- PHP 8.1, 8.2, 8.3 or 8.4
- PHP extensions: curl, json, iconv
- MySQL 5.7+ or MariaDB 10.3+
- An API key with at least one provider: [Anthropic](https://console.anthropic.com), [OpenAI](https://platform.openai.com) or [Mistral](https://console.mistral.ai)

## Installation

1. Download `dfaimetagen.zip` from your customer account.
2. In the PrestaShop back office, go to **Modules > Module Manager > Upload a module**.
3. Upload the ZIP and click **Install**.
4. The module creates 6 database tables (prefix `df_aimeta_`), installs 11 default CTR patterns and generates a random CRON token.
5. A new **AI Meta Generator** tab appears under the **Catalog** menu.

## AI provider configuration

1. Go to **Catalog > AI Meta Generator > Settings**.
2. Select your active provider: Anthropic, OpenAI or Mistral.
3. Paste your API key into the matching field.
4. Click the **Test** button next to the field to check connectivity — you should receive an "OK" reply.
5. Default models are `claude-sonnet-4-5`, `gpt-4o-mini` and `mistral-large-latest`. You can change them if you prefer another model from the same provider.

API keys are stored in PrestaShop's Configuration table and never exposed front-side. The module does not include AI credits: every generation consumes your own quota with the provider (roughly €0.0005 to €0.003 per generation).

## Generation settings

Still under **Settings**, you can adjust:

- **Length limits** — aligned by default with Google SERP recommendations: meta title 35–60 characters, meta description 120–158, ALT 25–125. If the AI exceeds these, text is cleanly truncated on a word boundary.
- **A/B variants per item** — 1 to 5 alternatives generated per entity and per language.
- **Anti-duplication threshold** — Jaccard similarity percentage above which a variant is rejected (85% by default). Comparison is accent-insensitive.
- **Batch size** — number of items processed per AJAX or CRON tick (10 by default, up to 100).
- **HTTP timeout** — maximum wait for a provider response (60 s by default).
- **Overwrite / Skip non-empty** — default behaviour for meta tags that already have a value.

## Running a bulk generation

1. Go to **Catalog > AI Meta Generator > Bulk Generation**.
2. **Entity**: products, categories, CMS pages, manufacturers, suppliers or product images.
3. **Field**: meta title, meta description or image ALT (ALT applies to product images).
4. **CTR pattern**: pick a specific pattern or leave _Auto_ to use the field's default pattern.
5. **Languages**: multi-select — generation is multiplied (items × languages).
6. **Scope**: all entities, by ID list, or by category / manufacturer filter.
7. **Limit**: set 10 or 20 for a test, 0 to process everything.
8. Click **Create job**.

Always start with a job limited to 10–20 items to validate the tone and format of the generated copy, adjust the pattern or template if needed, then re-run with no limit.

## Monitoring and running jobs

The **Jobs** page lists all jobs with progress, statistics (succeeded / failed / skipped) and status. Three execution modes:

- **Run until complete** (job detail page) — processes batches in a loop via AJAX with a live progress bar. Keep the tab open.
- **Run one batch** — processes a single batch then reloads the page.
- **CRON** — background processing, recommended for large catalogs (see below).

A job can be cancelled mid-run, restarted from scratch, or deleted. The full history of each generation (status, input/output tokens, error message) is kept in the History tab of the job detail page.

## CRON setup

1. In **Settings**, CRON section, copy the displayed URL. It has the form: `https://your-shop.com/modules/dfaimetagen/cron.php?token=YOUR_TOKEN`
2. Add it to your server crontab, for example every 5 minutes: `*/5 * * * * curl -s "https://your-shop.com/modules/dfaimetagen/cron.php?token=YOUR_TOKEN" >/dev/null`
3. Each run processes up to 5 batches of the oldest pending job. Optional parameters: `&batch=20` (batch size) and `&loops=10` (batches per run).

The token protects the endpoint: do not share it. If in doubt, regenerate it from Settings ("Regenerate token" button) — remember to update your crontab afterwards.

## A/B variants and activation

Each generation produces the configured number of variants (1 to 5). The first valid variant is written to the entity and marked **Active**. The others remain on standby in the job detail page:

- Click **Activate** next to a variant to write it to the entity immediately.
- Other variants of the same triplet (entity, field, language) are automatically deactivated.
- The character counter next to each variant lets you check SERP compliance at a glance.

## CTR patterns

The 11 preinstalled patterns cover three families:

- **Meta titles**: benefit + year, numbered list, USP brackets, hook question, power words.
- **Meta descriptions**: benefit stack, social proof, problem-solution, direct CTA.
- **Image ALT**: descriptive, contextual.

To create your own patterns, go to **Catalog > AI Meta Generator > Patterns**. The template accepts dynamic tokens:

- `{NAME}`, `{BRAND}`, `{CATEGORY}`, `{PRICE}`, `{YEAR}`, `{NUMBER}`, `{LANG_NAME}` — filled automatically by the module;
- `{BENEFIT}`, `{USP}`, `{CONTEXT}` — filled by the AI at generation time.

Patterns marked "system" ship with the module and are preserved across updates.

## Advanced prompt templates

For full control over AI behaviour, create templates under **Catalog > AI Meta Generator > Prompt Templates**. Each template targets a triplet (entity, field, language — or all languages) and defines:

- the **system prompt** — role, tone, global constraints;
- the **user prompt** — with the tokens `{NAME}`, `{BRAND}`, `{CATEGORY}`, `{DESCRIPTION}`, `{PRICE}`, `{PATTERN}`, `{LANG_NAME}`, `{MIN_LENGTH}`, `{MAX_LENGTH}`, `{AB_VARIANTS}`, `{EXISTING}`.

Mark a template as "default" so it applies automatically to its triplet.

## Anti-duplication

Before keeping a variant, the module compares it to already-stored variants:

1. **Exact hash** (sha1 of the normalized version) — immediate rejection on perfect duplicates.
2. **Jaccard similarity** on normalized word sets (lowercase, accent-stripped) — rejection if similarity exceeds the configured threshold.

A rejected variant is automatically re-generated by the AI (within the batch's retry limit).

## Dashboard

The **Dashboard** page aggregates: job counts (total, pending, completed), generated and active variants, successful / failed generations, tokens consumed (input + output), latest jobs and latest generations. Use it to monitor your AI budget and catch provider errors.

## Multi-shop

The module reads and writes values shop-aware whenever the relevant `*_lang` table has an `id_shop` column. Select the target shop in the bulk generation form if your installation is multi-shop.

## Troubleshooting

- **"FAIL" on the connectivity test** — check the API key, the provider's credit balance, and that your server allows outbound HTTPS connections (cURL) to api.anthropic.com, api.openai.com or api.mistral.ai.
- **Job stuck in "running"** — run one batch manually from the detail page, or wait for the next CRON run. A job can always be cancelled then restarted.
- **Empty or truncated variants** — increase the HTTP timeout in Settings, or choose a faster model.
- **403 on the CRON URL** — the URL's token no longer matches (it may have been regenerated). Copy the URL again from Settings.
- **Nothing generated for some entities** — if "Skip non-empty" is active, entities with an existing value are skipped by design. Tick "Overwrite" to force.

## Uninstall

Uninstalling drops the module's 6 tables and its configuration keys. Meta tags already generated and written to your products, categories and images are kept: they are part of your catalog.
