PS PrestaShop Intermediate

Smart Content – Documentation

Install, configure and run Smart Content: segments, campaigns, A/B testing, AI and analytics.

Updated Module version 1.0.0

Overview

DataFirefly Smart Content personalizes your PrestaShop store’s content based on each visitor’s profile, behavior, cart and context. The principle is simple: you define segments (audiences), then campaigns that tie a segment to HTML content shown in a theme zone. On every page, the module evaluates the visitor and displays the content of the highest-priority campaign whose segment matches.

The module covers the whole cycle: behavioral segmentation, multi-zone delivery, A/B testing, conversion analytics and two AI assistants (content generation and segment suggestions).

Compatible with PrestaShop 1.7.6 to 8.x and 9.x, multistore and multilingual. No personal data is stored.

Installation

  1. Drop the dfsmartcontent folder into your store’s /modules/ directory, or install the ZIP from Modules → Module Manager → Upload a module.
  2. Click Install. The tables and admin tabs are created automatically.
  3. A new Smart Content menu appears, with four sub-sections: Dashboard, Campaigns, Segments and Settings.

Configuring the settings

Go to Smart Content → Settings. Two families of parameters are available there.

AI parameters

  • AI endpoint URL: the chat-completions endpoint (OpenAI / Mistral compatible). Default: https://api.mistral.ai/v1/chat/completions.
  • AI model: for example mistral-large-latest or gpt-4o-mini.
  • AI API key: your key, stored server-side and never exposed to the front office. While empty, AI features are disabled but the rest of the module works normally.

Privacy

  • Respect cookie consent: enabled by default. Tracking beacons (impressions / clicks) only fire once consent is detected.

Any provider exposing a standard chat-completions contract works. Just adjust the URL and model name.

Creating a segment

A segment is an audience defined by one or more rules. Go to Smart Content → Segments → Add segment.

  • Name: an internal label (e.g. “VIP customers”).
  • Match logic: Match ALL rules (AND) requires every rule to be true; Match ANY rule (OR) only needs one to be.
  • Priority: higher-priority segments are evaluated first.
  • Rules: add your conditions row by row with the visual builder.

A segment with no rules matches everyone: handy as a “default” audience.

Rule reference

Each rule has an attribute, an operator and a value. For lists, separate values with commas. For ranges (the between operator), give two comma-separated values.

  • customer_group — customer group (IDs). Operators: in / not_in.
  • logged_in — logged-in visitor (1 or 0). Operator: eq.
  • new_returningnew or returning based on order history. Operator: eq.
  • country — country (IDs). Operators: in / not_in.
  • language — language (IDs). Operators: in / not_in.
  • currency — currency (IDs). Operators: in / not_in.
  • devicedesktop, tablet or mobile. Operator: in.
  • orders_count — number of valid orders. Operators: gte / lte / eq / between.
  • total_spent — total spent. Operators: gte / lte / between.
  • days_since_order — days since the last order. Operators: gte / lte / between.
  • cart_total — current cart total. Operators: gte / lte / between.
  • cart_has_category — category present in the cart (IDs). Operator: in.
  • cart_has_product — product present in the cart (IDs). Operator: in.
  • newsletter — newsletter subscriber (1 or 0). Operator: eq.
  • source_utm — session UTM source. Operators: eq / contains.
  • referrer — referring site. Operators: contains / not_contains.
  • hour_range — time range (e.g. 9,18). Operator: between.
  • weekday — day of week (1 = Monday … 7 = Sunday). Operator: in.
  • visits — visitor’s visit count. Operators: gte / lte / eq.

The “Reference IDs” panel below the builder lists the IDs of your groups, languages and currencies so you don’t have to look them up elsewhere.

Example — segment “High spenders to re-engage”, AND logic: total_spent gte 200 + days_since_order gte 60.

Creating a campaign

A campaign delivers content to one or more segments in a theme zone. Go to Smart Content → Campaigns → Add campaign.

  • Name: internal label.
  • Display zone: the hook where the content appears (see the list below).
  • Target segments: one or more segments. Leave empty to target every visitor.
  • Priority: if several campaigns target the same zone, the highest-priority matching one wins.
  • A/B testing: enable to deliver several variants (see the dedicated section).
  • Frequency cap: maximum impressions per visitor (0 = unlimited), over a window expressed in days.
  • Start / end dates: optional campaign scheduling.
  • Content variants: the HTML content, editable per language.

Available display zones

displayHome, displayTop, displayNav1, displayBanner, displayWrapperTop, displayWrapperBottom, displayLeftColumn, displayRightColumn, displayFooter, displayProductAdditionalInfo, displayShoppingCartFooter.

A/B testing

Enable the A/B testing option on the campaign, then add several variants. Each variant has a label (A, B, …) and a weight. The module draws a variant at random on each display, proportionally to the weights. Without A/B testing, the first active variant is used.

Each variant’s content is entered per language. The dashboard then compares each variant’s performance (impressions, CTR, CVR, revenue).

For a 50/50 test, give both variants the same weight (e.g. 1 and 1). For a 70/30 split, use 7 and 3.

AI content generator

In the campaign editor, the AI content generator panel writes a conversion-focused HTML block. Enter the segment name, an audience description, the message goal and the tone, choose the language, then click Generate. The produced content is inserted into the text area of the active variant / language.

This feature requires an API key set in the Settings.

AI segment suggestions

From Smart Content → Segments, the AI segment suggestions button opens a page that summarizes your store’s real statistics (active customers, orders, repeat buyers, newsletter subscribers…). Click Generate suggestions: the AI proposes 3 to 5 high-value segments, each with a description, a rationale and a set of rules ready to copy into the creation form.

Dashboard and analytics

Smart Content → Dashboard aggregates performance over the chosen period: impressions, clicks and click-through rate (CTR), conversions and conversion rate (CVR), and attributed revenue. One table breaks results down per campaign, and a second compares A/B variants.

How conversions are attributed

When a personalized block is clicked, the last interaction (campaign, variant, segment) is stored in the session cookie. On order validation, the module credits the conversion and its revenue to that campaign, then clears the attribution to avoid double counting.

Privacy and GDPR

  • No personal data is stored: tracking relies on an anonymous visitor identifier (a hash), used for the frequency cap and de-duplication.
  • The Respect cookie consent option gates when measurement fires. Recognized signals: window.dfscConsentGranted = true, or the cookies hideBanner=1, axeptio_authorized, cookieconsent_status=allow.
  • To wire your own CMP, set window.dfscConsentGranted to true once consent is granted.

Inserting via widget

The module implements PrestaShop’s widget interface. You can therefore insert a block directly into a template:

{widget name='dfsmartcontent' hook='displayHome'}

The hook parameter indicates which zone to evaluate.

FAQ and troubleshooting

My block does not show

Check that the campaign is active, that its zone matches a hook present in your theme, that at least one variant has content for the current language, and that the visitor actually matches a targeted segment. If a frequency cap is reached, the block is no longer shown to that visitor within the defined window.

Statistics stay at zero

If the consent option is on, beacons only fire after approval. Check that your cookie banner emits one of the recognized signals, or set window.dfscConsentGranted.

AI features return an error

Make sure the API key, URL and model are correct in the Settings, and that your server can reach the endpoint outbound.

Was this page helpful?

Still stuck? Contact support