Search by

yespo / module-cdp

devops_yespo

Yespo CDP integration for Magento 2

Package info

github.com/Yespo-CDP/yespo-magento

Homepage

Documentation

Type:magento2-module

pkg:composer/yespo/module-cdp

Statistics

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.3.3 2026-12-02 19:34 UTC

README

Magento 2.4.4 - 2.4.9 PHP Latest Stable Version Total Downloads License

Magento 2 module that connects a store to Yespo CDP: it registers the store domain, installs the tracking scripts, keeps contacts and orders in sync, and sends storefront behaviour events.

Contents

  1. Overview
  2. Requirements and compatibility
  3. Installation
  4. Quick start
  5. How it works
  6. Features
  7. Queue consumers
  8. CLI commands
  9. Configuration reference
  10. Error handling and self-healing
  11. Logging and monitoring
  12. Security and privacy
  13. Troubleshooting
  14. Disconnecting and uninstalling
  15. Development and testing
  16. Triggers, queue topics and API calls
  17. Yespo API reference
  18. Support and license

Overview

Feature What it does Yespo API
Onboarding Checks the API key, registers the store domain, installs the site tracking script Get account info, Create domain, Get script
Web Push Registers the Web Push domain, serves the service worker Add Web Push domain, Get Web Push script
Contacts sync Real-time customer create/update/delete and a historical import of the customer base Add contact, Bulk update contacts, Delete contact, Import session status
Orders sync Real-time order create/status change and a historical import, with an editable status mapping Bulk insert orders
Web tracking Page-view events from the browser, cart, purchase, customer and wishlist events from the server Web tracking via eS.JS, Behaviour data via REST API
Self-healing Status reconciliation, automatic disable on a bad key, automatic recovery after outages Get account info

Everything that talks to Yespo after onboarding (contacts, orders, tracking events) goes through Magento's message queue. It never blocks a storefront request, but it also means nothing moves until a queue consumer is running. On a standard Magento the cron starts the consumers by itself; see Queue consumers if an install looks "stuck".

Using the module requires a Yespo account. The Yespo service has its own terms and paid plans, see Yespo terms.

Requirements and compatibility

  • Magento Open Source 2.4.4 - 2.4.9, PHP 8.1 - 8.5. Supported pairs, per Adobe's system requirements:

    Magento PHP
    2.4.4, 2.4.5 8.1
    2.4.6 8.1, 8.2
    2.4.7 8.2, 8.3
    2.4.8 8.3, 8.4
    2.4.9 8.5
  • A Yespo account and an API key with Full Access to API (how to create one).

  • Magento cron running every minute (see Queue consumers).

  • Outbound HTTPS from the server to api.yespo.io, tracker.yespo.io and events.yespo.io.

  • Dependencies (see composer.json): Magento_Amqp, Magento_Authorization, Magento_Backend, Magento_Catalog, Magento_CatalogInventory, Magento_Checkout, Magento_Config, Magento_ConfigurableProduct, Magento_Cookie, Magento_Cron, Magento_Csp, Magento_Customer, Magento_CustomerImportExport, Magento_Directory, Magento_Eav, Magento_ImportExport, Magento_MysqlMq, Magento_Quote, Magento_Sales, Magento_Store, Magento_Tax, Magento_Ui, Magento_Wishlist and guzzlehttp/guzzle.

The module works on both queue backends Magento supports: the database (db, default) and RabbitMQ (amqp). Nothing in the module changes between them, see Queue backend.

Installation

Composer

The module is published on Packagist. Its magento/* dependencies come from repo.magento.com, which needs Adobe Commerce Marketplace access keys (My Profile > Access Keys). A store installed through Composer usually has them already. If not, store them in auth.json in the Magento root or in ~/.composer/:

{
    "http-basic": {
        "repo.magento.com": {
            "username": "<public key>",
            "password": "<private key>"
        }
    }
}

Without the keys composer require fails with 401 Unauthorized.

composer require yespo/module-cdp
bin/magento module:enable Yespo_Cdp
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

Manual

Copy the module to app/code/Yespo/Cdp, then run the same four bin/magento commands.

After the first setup:upgrade check that the schema is complete:

bin/magento setup:db:status
bin/magento queue:consumers:list | grep yespo      # 7 consumers

The module adds seven tables (yespo_cdp_contact_retry, yespo_cdp_contact_bulk_session, yespo_cdp_pending_resync, yespo_cdp_pending_delete, yespo_cdp_pending_order_resync, yespo_cdp_tracked_order, yespo_cdp_cart_guid) and no changes to core tables.

Quick start

  1. Create an API key in Yespo: Settings > API keys (my.yespo.io), type Full Access to API.
  2. In the Magento admin open Stores > Configuration > Yespo CDP (or the top-level Yespo CDP menu item).
  3. Pick a Website (shown only when the installation has more than one), paste the key and click Connect.
  4. Wait for the onboarding steps to turn green: account check, domain registration, site script, Web Push.
  5. Make sure queue consumers run (Queue consumers).
  6. Open Contacts sync or the Data sync block of the connection page and switch Enable on to start the historical import of contacts and then orders.

Each step shows its own status. On an ordinary failure a step retries itself 5 times, 3 seconds apart, and then shows Try again (re-runs only that step) and Contact support (opens https://yespo.io/contact-us) side by side.

How it works

Magento event (customer saved, order placed, cart changed ...)
        |
   Observer  ---- catches every Throwable, logs, never breaks the storefront
        |
   Message queue topic  yespo.contact.* / yespo.order.* / yespo.event.publish / yespo.pending.resync
        |
   Consumer (cron_consumers_runner or systemd)
        |
   Api\ApiClient -> HttpClient  (rate limit, retries, key handling, request id)
        |
   Yespo REST API   https://api.yespo.io/api/v1/...   and   https://tracker.yespo.io/api/v2
  • Observers do no network I/O. They build a small message and publish it. A failure in an observer is logged and swallowed, so a Yespo outage can never stop a customer from registering or checking out.
  • One HTTP client. All calls go through Model/Api/HttpClient, which adds authentication, applies the rate limit, retries 429/5xx responses on the configured schedule and tags every request with a short request id.
  • Per-website connection. The integration is connected for one Magento website. Contacts and orders of other websites are not sent. Exception: with Share Customer Accounts = Global (Stores > Configuration > Customers > Customer Configuration > Account Sharing Options) a customer of any website can shop on the connected one, so the contacts of every website are synced (Contact Deletion Mode of the connected website applies); orders and web tracking stay on the connected website.
  • State in the database. Retry rows, import sessions, pending changes and tracked orders live in the seven yespo_cdp_* tables, so a restart or a deploy loses nothing.

Authentication

Every API request is sent with HTTP Basic authentication built from the API key (Authorization: Basic base64("user:<API key>")), as described in the Yespo API integration guide. The key is stored in core_config_data encrypted with Magento's encryptor, is never written to logs, and is never exposed to the browser. A 401 response disables the integration instead of being retried, see Error handling.

Features

Site domain and tracking script

Purpose: let Yespo recognise the store and install its JavaScript on every storefront page.

What happens on Connect

  1. Get account info confirms that the key is valid.
  2. Create domain registers the website's storefront domain (POST /api/v1/site/domains).
  3. Get script downloads the site script (GET /api/v1/site/script). The module injects it into the storefront in a way that is compatible with Magento's Content Security Policy and with Full Page Cache.

The Yespo hosts that the script needs are added to the CSP allowlist by etc/csp_whitelist.xml.

One domain per connection. Yespo registers only one site domain per organisation, and a Web Push domain can belong to one organisation only. The module registers the host of the connected website's default store view. The site script runs on every store view of that website, but Web Push works only on that one domain. Store views on other domains need their own (child) Yespo account.

Web Push

Purpose: collect Web Push subscriptions from visitors and let Yespo send notifications.

  1. Add Web Push domain registers the domain for Web Push (POST /api/v1/site/webpush/domain).
  2. Get Web Push script returns the service worker code (GET /api/v1/site/webpush/script).
  3. The module writes the worker per website and serves it from the store root as /push-yespo-sw-<websiteId>.js (under the base URL path, e.g. /shop/push-yespo-sw-<websiteId>.js, which is also sent to Yespo as serviceWorkerPath / serviceWorkerScope), so browsers can register it with the right scope. If pub/ is read-only (Adobe Commerce Cloud, immutable deployments), the same URL is served from the stored content by the module's router; the step succeeds only after the module has fetched that URL and got the stored worker back. The page script is saved only once the worker is installed.

Web Push requests use a longer timeout than the rest (60 s, see Config-only settings). The Sync Domain/Web Push Status cron keeps the local state in line with Yespo and repairs it when it drifts.

Contact Sync

Purpose: keep Yespo contacts in line with Magento customers - new, changed and deleted - and import the existing customer base once.

Real-time sync. These Magento events publish a message that a consumer sends with Add contact (POST /api/v1/contact):

Magento event Result in Yespo
customer_save_after Contact created or updated
customer_address_save_after, customer_address_delete_commit_after Contact updated (address and phone)
customer_delete_after Contact deleted, in the mode chosen under Contact Deletion Mode
System > Data Transfer > Import (Customers Main File, Customer Addresses, Customers and Addresses) Imported customers are created/updated, deleted ones are deleted in the Contact Deletion Mode (the import writes to the database without the events above, so a plugin on the import picks the changes up)

Historical (bulk) import. Triggered by Enable / Try again in the admin or by bin/magento yespo:sync:customers.

  1. The customers of the connected website are read page by page, at most 2000 per request (Yespo accepts up to 3000 contacts per request).
  2. Each page is sent with Bulk update contacts (POST /api/v1/contacts). Yespo deduplicates by externalCustomerId, email and phone, so a customer that already exists is updated, not duplicated.
  3. Yespo answers with an import session. A cron job polls Import session status (GET /api/v1/importstatus/{sessionId}) and updates the counters.
  4. Each batch publishes the next one, so the import is a chain of small queue messages and survives restarts.

While the toggle is off. Changes are recorded in yespo_cdp_pending_resync, yespo_cdp_pending_delete and yespo_cdp_pending_order_resync and replayed in batches when sync is enabled again. Disable only pauses the toggle: no disconnect, no data loss. Deletions are kept even after a complete import, since a re-import never removes a contact. Before Data sync is enabled for the first time only deletions are recorded: the first import reads every contact and order anyway. The same applies while the integration is paused (invalid key or connection failures): changes and deletions are recorded, also when a queued message reaches a consumer during the pause, and replayed once it is re-enabled.

Contact delete modes (Contacts sync tab):

Mode Behaviour Yespo call
Manual Delete (default) Soft delete: the contact is removed but stays linked to its orders and can be restored Delete contact
GDPR Erase The contact is erased permanently on Yespo's side (erase=true), rate limited to 13 per hour (shared by every consumer process; a request Yespo did not process, network error or 5xx, gives its slot back) Delete contact with erase=true

Contact field mapping

Yespo field Magento source
externalCustomerId Customer ID
firstName / lastName firstname / lastname, cut to 40 characters; a name with no letter is left out, because Yespo refuses the whole contact otherwise
channels[type=email] email
channels[type=sms] Phone: the configured attribute, or the default address telephone, cleaned as described below
address.address, .town, .region, .postcode, .countryCode Selected address (billing or shipping, per configuration)
languageCode / timeZone Store general/locale/code (two letters) / general/locale/timezone

Status and counters. The connection page shows live Total, Synchronized, Successful and Failed counters for Contacts and Orders. A contact that Yespo rejects is counted and its reason is written to the log; one bad contact does not fail the batch.

Phone normalisation is the same in PHP and in the storefront JS and does not depend on a country: every character except digits and a leading + is removed (so an extension such as ext 5 leaves its digits in the number), a + in the middle is dropped, and a value without digits is not sent. The number is not checked or changed in any other way: the country code is never added, replaced or validated.

Phone Attribute is the customer attribute sent as the phone number; only that attribute is sent. Choose -- Use Default Address Phone Number -- to take the phone from the default billing address, or the default shipping address if there is none. A customer without a value is synced without a phone.

The phone attribute is locked once the historical import has started. To change it, disconnect and connect again.

Order Sync

Purpose: send every order, and each change of its status, to Yespo; import the order history once.

Real-time sync. sales_order_save_after publishes yespo.order.sync; the consumer sends the order with Bulk insert orders (POST /api/v1/orders). Storefront orders and orders created in the admin are both covered. Editing an order address (admin Edit Address, REST PUT /V1/orders/:parent_id) does not save the order, so a plugin on OrderAddressRepositoryInterface::save queues it too.

Historical import. Runs automatically once the contact import has finished, or by hand with bin/magento yespo:sync:orders [--batch-size=N] [--from-date=Y-m-d]. Batches are capped at 1000 orders per request; the status of the import is read the same way as for contacts.

Order field mapping

Yespo field Magento source
externalOrderId Order increment ID
externalCustomerId Customer ID (only when a registered customer placed the order)
status / statusDescription Mapped status (see below) / the Magento status label
totalCost / currency / date Grand total / order currency / created-at (ISO 8601, UTC)
email / phone / firstName / lastName Customer email, billing address phone and name
deliveryAddress Shipping address (billing as a fallback), comma-joined
deliveryMethod / paymentMethod Shipping description / payment method title
shipping / discount / taxes Shipping amount / abs(discount) / tax amount

Order items

Yespo field Magento source
externalItemId Simple product ID, never the SKU. A configurable product is reported as the simple product that was bought. A bundle is reported as its component products, with the bundle price and discounts spread over them to the cent, so the lines add up to the order
name, quantity Item name (the variant name for a configurable product), quantity ordered
cost Unit price after the line's discount; follows the store's tax display setting for orders
category Deepest assigned category, Uncategorized when there is none (Yespo requires it)
url, imageUrl Product page and image; a configurable or grouped line uses its parent's URL
description Chosen options and bundle selections, the available downloadable links, otherwise the short description. Custom option text and uploaded files are never sent

Order status mapping (Stores > Configuration > Yespo CDP > Orders sync), built-in defaults:

Magento status Yespo status
pending, pending_payment, holded, payment_review INITIALIZED
processing IN_PROGRESS
complete, closed DELIVERED
canceled, fraud CANCELLED
any other, unmapped status not sent: the whole order is skipped

A skipped order is not counted as a failure and is not queued for retry; saving a mapping later does not resend it. Save stores the mapping without enabling Data sync. Until the first Enable every row is editable. After it, saved mappings are read-only, even after Disable; unmapped rows stay editable and become read-only once saved. To change a saved mapping, disconnect and reconnect the integration.

Web Tracking

Purpose: feed Yespo with the behaviour data it needs for segmentation, recommendations and abandoned-cart scenarios. It works as soon as the site script is installed, independently of Data sync. The master switch and each event are under Stores > Configuration > Yespo CDP > Web tracking.

Frontend events are sent from the browser by the site script (eS.JS events):

Event When Payload
MainPage Home page view -
NotFound 404 page -
CategoryPage Category page view -
ProductPage Product page view productKey, price, isInStock. For a configurable product the event carries the cheapest salable variant and is sent again when the visitor picks options
StatusCartPage Cart page view -
SearchRequest Search with no results -
CustomerData Details a visitor types at checkout, in the register form or in the login form email, name, phone

Backend events are published to yespo.event.publish and delivered to POST https://tracker.yespo.io/api/v2 (behaviour data via REST API):

Event Magento trigger Notes
StatusCart sales_quote_save_commit_after Cart add/update/remove, in the currency the shopper sees. Sent from the server for the storefront and for a headless storefront over REST / GraphQL with a customer token or as a guest - not with an admin or integration token. An unchanged cart is not sent again, a switch of the currency with no cart change sends nothing until the next change. Placing an order sends an empty cart. A bundle is reported as its components
PurchasedItems sales_order_save_commit_after of an order marked on sales_order_place_after Order placed and committed (a failed order save sends nothing); carries the cart GUID that links the purchase to the cart events
CustomerData Registration, customer_login (storefront, or a REST / GraphQL customer token issued for the password), a change of the customer's own profile or default address phone Identifies the visitor to Yespo. Only for the customer's own session or token: not for an admin, an integration, Login as Customer or another account edited on the storefront
AddToWishlist Wishlist::addNewItem Product added to the wishlist: storefront, GraphQL, move from the cart

The visitor is matched to Yespo's session through the sc cookie of the site script. A backend event is delivered only when the Magento request that caused it carried this cookie; without it the event is skipped. Every backend event identifies the shopper with what Magento knows: customer ID, email, name and, when phone sync is enabled, phone. A failed backend event (400, 429, 5xx, network) is logged and dropped: there is no retry queue for tracking, unlike contacts and orders. Prices follow the shop's display setting (with or without tax).

Headless storefronts. Contacts and orders work for a storefront on REST or GraphQL. Backend events work only when the requests to Magento carry the sc cookie of the site script. The frontend events, the site script and the Web Push script come from the module's templates and JavaScript: a storefront that does not render them sends no frontend events, and the module has no REST endpoint to send them. A profile or address change made over REST / GraphQL carries the sc cookie only within the customer's own browser session. With a customer token alone it is skipped: a Login as Customer token looks like the customer's own, so the admin's browser is never linked to the contact.

Queue consumers - setup

The module publishes to yespo.contact.sync / .delete / .bulk_batch, yespo.order.sync / .bulk_batch, yespo.event.publish (Web Tracking's backend events) and yespo.pending.resync (replays changes made while Data sync was off, in batches, when it is enabled again). Something has to run bin/magento queue:consumers:start for each.

On a standard Magento nothing has to be set up. The core cron job consumers_runner starts the consumers, all of them by default, including the seven of this module. The usual crontab line is enough: cron:run starts the core consumers cron group in its own process by itself.

bin/magento cron:install          # bare-metal; markshust docker: bin/cron start
crontab -l | grep cron:run        # verify: line is  * * * * *

Setup is needed only in these cases:

Case in app/etc/env.php or on the server What to do
cron_consumers_runner/consumers lists some consumers add the seven yespo.* names (Option A)
cron_consumers_runner/cron_run is false run the consumers with your process manager (Option B)
PHP may not start processes (exec is disabled) run the consumers with your process manager (Option B)

Use either the cron runner or your own process manager for these consumers, not both (double processing).

Queue backend: db (default) or RabbitMQ (amqp)

The module works on either backend and its code does not change. Stock Magento uses db (queue_message tables). To move to RabbitMQ, add to app/etc/env.php inside the returned array:

'queue' => [
    'amqp' => [
        'host' => 'rabbitmq',
        'port' => '5672',
        'user' => '<user>',
        'password' => '<password>',
        'virtualhost' => '/',
    ],
    'default_connection' => 'amqp',
    'consumers_wait_for_messages' => 1,
],
  • default_connection selects the backend; amqp holds the connection details.
  • consumers_wait_for_messages => 1 keeps a consumer alive waiting for new messages; with 0 it exits as soon as the queue is empty.
  • This block only decides where messages are stored. It does not start any consumer - you still need Option A or B.
  • After changing it, run bin/magento setup:upgrade (declares the exchanges and queues in RabbitMQ), bin/magento cache:flush, and stop the old consumers (pkill -f queue:consumers:start) so they reconnect with the new settings. Messages already waiting on the old backend are not migrated.

Older Magento versions. Magento 2.4.4 ignores queue/default_connection: once the amqp block exists, every queue without an explicit connection goes to RabbitMQ whatever default_connection says. The module therefore ships a small plugin on Magento\Framework\MessageQueue\DefaultValueProvider that reads the setting from env.php, so the block above behaves the same way on every supported version. On versions that already read the setting themselves the plugin does nothing. The plugin is global: on those older versions queue/default_connection then applies to the queues of every module, not only Yespo's - which is what the setting means in newer Magento, but check other extensions' consumers after setting it. etc/queue_topology.xml declares both exchanges (magento-db for db, magento for amqp) because Magento 2.4.4 requires a connection on every exchange.

Option A - cron_consumers_runner (cron-managed, no host access)

Works with no env.php changes at all (all consumers, max_messages 10000). Add the block below only to restrict the list, lower max_messages or set multiple_processes:

'cron_consumers_runner' => [
    'cron_run' => true,
    'max_messages' => 1000,
    'consumers' => [
        'yespo.contact.sync', 'yespo.contact.delete', 'yespo.contact.bulk_batch',
        'yespo.order.sync', 'yespo.order.bulk_batch', 'yespo.event.publish',
        'yespo.pending.resync',
    ],
],
bin/magento cache:flush

Magento cron respawns a dead consumer on its next * * * * * tick - fine for low and moderate volume.

Run every consumer instead of a whitelist: leave consumers empty ('consumers' => []) or omit the key. Magento treats an empty list as "all consumers allowed" (Magento\MessageQueue\Model\Cron\ConsumersRunner). That starts not only yespo.* but every consumer Magento declares, each as its own PHP process, so on a large catalog prefer the whitelist above.

Option B - systemd unit (recommended for production and higher volume)

Restarts a dead consumer in 1-2 seconds instead of up to 60. Run on the host, one unit instance per topic:

[Service]
ExecStart=/usr/local/bin/php bin/magento queue:consumers:start %i --max-messages=1000
ExecStop=/usr/bin/pkill -f "queue:consumers:start %i"
Restart=always
RestartSec=2
sudo systemctl enable --now yespo-queue-consumer@yespo.contact.{sync,delete,bulk_batch}
sudo systemctl enable --now yespo-queue-consumer@yespo.order.{sync,bulk_batch}
sudo systemctl enable --now yespo-queue-consumer@yespo.event.publish
sudo systemctl enable --now yespo-queue-consumer@yespo.pending.resync

--max-messages is not optional here - without it, a configuration change (API key, Save Config, setup:upgrade) never reaches an already-running consumer, and without ExecStop, restarting the unit leaves an orphaned duplicate process behind (consumers > 1 on that queue).

Never run more than one process per *.bulk_batch topic - each batch chains itself by publishing the next, and the progress counters are not lock-safe against a race. yespo.contact.sync and yespo.contact.delete are safe to run twice in parallel; keep it at 2, because Yespo's rate limit is per process and three or more trigger real HTTP 429.

Verify

bin/magento queue:consumers:list | grep yespo
docker exec <rabbitmq-container> rabbitmqctl list_queues name messages consumers | grep yespo   # amqp backend only

Do not expect consumers = 1. Consumers started with --max-messages (the Option B units and the Option A cron runner) poll the queue instead of subscribing to it, so RabbitMQ reports consumers = 0 while they run normally. Check that rabbitmqctl list_connections shows one connection per running consumer (or systemctl status 'yespo-queue-consumer@*' for Option B), and watch messages: a count that keeps growing is the real warning sign.

CLI commands

bin/magento yespo:sync:customers [--batch-size=N]
bin/magento yespo:sync:orders [--batch-size=N] [--from-date=Y-m-d]

Same historical import as the admin Enable / Try again buttons. Both commands publish queue messages and return; the consumers do the sending. --from-date limits the order import to orders created on or after that date. Both commands refuse to run until Data sync is enabled, and while the integration is paused.

Configuration reference

Admin paths are under Stores > Configuration > Yespo CDP. Every field except the connection itself is stored at the default scope.

Tab What it holds
Data sync Website, API key, Connect / Disconnect, the status of each onboarding step, the Data sync block
Contacts sync Phone attribute, contact delete mode
Orders sync Magento status to Yespo status mapping
Web tracking Master switch and a toggle per event (customer data, cart status, purchased items, category page, search request, add to wishlist)
System settings Debug logging, bulk batch sizes, Reset System Settings, see System options for every field

System options

Setting Default Purpose
Enable Debug Logging Off Adds the request and response lines (method, URL, status, duration, never the body) and the success events of Yespo Monitoring to yespo_cdp.log, and widens API error logging to include Yespo's full response body. Errors and warnings are written either way. Turn on only while diagnosing: the log has no admin-role restriction.
Clean Config Cache Automatically On Cleans the config cache type when the integration is paused or resumed and when Data sync is enabled or disabled. See Automatic config cache cleaning.
Bulk Sync Batch Size (Contacts sync) 2000 (hard maximum) Customers per historical-import request. An import that is already running keeps the size it started with.
Bulk Sync Batch Size (Orders sync) 1000 (hard maximum) Orders per historical-import request. An import that is already running keeps the size it started with.

Reset System Settings removes every saved value of the section, including the config-only ones below.

Automatic config cache cleaning

Why it exists. The integration state - enabled, paused by an invalid key or by connection failures, Data sync on or off - lives in core_config_data. Cron jobs, queue consumers and the admin write it straight to the database at the moment it changes, and the consumers read it back from the database. The storefront observers (customer, address, order and deletion hooks) read the same flags from Magento's config cache instead, so a change reaches them only after that cache is rebuilt. Until then they act on the old state. Cleaning the config cache type right after each change closes that gap. Only this cache type is cleaned (never the full page cache), and only when the state actually changes: a pause, a recovery, or the Data sync toggle - not on every write.

What happens with the option off. The module still writes the state, but the storefront keeps the cached one until someone flushes the cache:

  • After Enable or Disable of Data sync the admin gets the notice Please flush the cache ..., as before. A pause or a recovery happens in cron, so there is no notice: flush the cache when the admin notice about a paused integration appears or disappears.
  • Paused, but the storefront still sees it enabled: messages are queued and the consumers keep them for replay. Nothing is lost.
  • Resumed, but the storefront still sees it paused: changes go to the pending tables instead of the queue and reach Yespo with the Replay Pending Changes cron, up to 5 minutes later.
  • Data sync enabled again after a complete import, but the storefront still sees it off: changes are not recorded at all, because a re-import is about to run. A customer or order that changes after its own batch was already sent stays outdated in Yespo until it changes again. This is the one case where the old state costs data, so keep the option on unless the cache is flushed right after every toggle.

Turn the option off only where background processes must never clean a cache, for example when the cache is managed externally by the deployment.

Config-only settings (not in the admin)

These have safe defaults and are deliberately not shown in the admin, so they cannot be changed by mistake. Override one only on request from Yespo support, with bin/magento config:set <path> <value> or env.php (system > default). An empty value means the default.

Setting Default Config path (yespo_cdp_options/...)
HTTP timeout: Web Push 60 s (other requests: 5 s) advanced/http_timeout_web_push
HTTP timeout: bulk contacts and orders (/contacts, /orders) 60 s advanced/http_timeout_bulk
Rate limit: contacts, orders, subscriptions 200 req/s advanced/rate_limit_default
Rate limit: Generate Event API 350 req/s advanced/rate_limit_event_v3
Rate limit: Web Tracking API 50 req/s advanced/rate_limit_tracker
Rate limit: contact delete with GDPR Erase 13 per hour contacts_advanced/contact_delete_erase_rate_limit
Queue backlog alert threshold 500 messages (db backend only) advanced/queue_backlog_threshold
Stuck queue message threshold 15 min (first time: one retry; second time: marked failed) advanced/stuck_message_threshold_minutes
AMQP no-consumer alert threshold 5 min (amqp backend only) advanced/amqp_no_consumer_threshold_minutes
Pending resync batch size 500 advanced/pending_resync_batch_size
Retry: max attempts 5 sync_advanced/retry_max_attempts
Retry: bulk schedule 1,5,10 min sync_advanced/bulk_retry_schedule
Retry: real-time schedule 1,2,5 min sync_advanced/realtime_retry_schedule

Cron jobs (group yespo_cdp)

Job Default Config path Purpose
Sync Domain/Web Push Status */30 * * * * cron/sync_domain_status_schedule Status reconciliation; also re-enables an integration disabled by an invalid key once the key works again
Recover After Connection Failures */5 * * * * cron/recover_connection_schedule Probes Yespo while the integration is paused by connection failures, re-enables it and queues the changes made during the pause
Retry Contact/Order Sync * * * * * contacts_cron/retry_contact_sync_schedule Republishes due rows from the retry table
Replay Pending Changes */5 * * * * contacts_cron/replay_pending_schedule Queues the changes recorded during a pause or with Data sync off, and the changes real-time delivery gave up on (HTTP 401, retries exhausted), once both are on again
Check Bulk Import Sessions * * * * * contacts_cron/check_bulk_sessions_schedule Polls Yespo's import status and updates the Contacts / Orders counters
Check Queue Backlog */5 * * * * queue_cron/check_queue_backlog_schedule db backend only
Check Stuck Messages */5 * * * * queue_cron/check_stuck_messages_schedule See the stuck message threshold
Check AMQP Queues */5 * * * * queue_cron/check_amqp_queues_schedule amqp backend only
Clean Tracked Orders 30 3 * * * cron/clean_tracked_orders_schedule Deletes PurchasedItems de-duplication markers older than advanced/tracked_order_retention_days (30)

ACL resources

Access to each tab can be granted to an admin role separately (System > Permissions > User Roles): Yespo_Cdp::config with the children config_disconnect, config_general, yespo_cdp_contacts, yespo_cdp_orders, yespo_cdp_web and yespo_cdp_options.

Error handling and self-healing

Situation What the module does
429 or any 5xx from Yespo (including 520-526 from a CDN) Message goes to the retry table and is republished on the schedule (bulk 1, 5, 10 min; real-time 1, 2, 5 min; 5 attempts by default)
400 and any other 4xx (including 408) Terminal for that batch or message. The reason is logged. A batch stays failed until Try again
401 (invalid or revoked key) Never retried. On first entry the form stays editable. Mid-run the integration is disabled and an admin notice asks to disable it and connect with a valid key. When the same key starts working again, the status cron re-enables it. A 401 from the tracker or the log endpoint, which get no API key, is logged as an error and never disables the integration
Five failed data-transfer requests in a row (contacts, orders, import status; timeout or no answer) Integration is paused. The recovery cron probes Yespo every 5 minutes, re-enables it when Yespo answers, and queues the customers (including address changes), deletions and orders changed during the pause. A failing site script, Web Push or tracker call never counts
Onboarding step fails Retries 5 times, 3 seconds apart, then offers Try again and Contact support
Import batch stuck A batch whose Yespo session returns 404, or stays unresolved past the Bulk Import Session TTL (48 h), is marked failed and dropped automatically
Queue message stuck Retried once after the stuck threshold, marked failed the second time
Backlog or missing consumer Admin notice: backlog above the threshold (db), or no consumer for 5 minutes (amqp); clears by itself

Rate limiting is applied before the request is sent, so the module stays under Yespo's limits without needing a 429 first.

Logging and monitoring

  • Local log: var/log/yespo_cdp.log. Every HTTP call is tagged with a short request id ([a1b2c3d4]) that is repeated on the request line, on any transport-error line and in the exception message, so one failed call can be followed end to end with grep. The API key and request bodies are never written to the local log.

  • What is written, and when:

    Entry Debug off Debug on
    Errors (failed API calls, failed batches, exceptions in observers and consumers), without Yespo's response body yes yes, and an API error line and exception also carry the start of Yespo's response body (up to 1000 characters)
    Warnings, such as Yespo API slow response yes yes
    Progress messages of the module (Yespo CDP: dispatched contact bulk batch #1 ..., synced contact for customer #N, queue and recovery notices) yes yes
    Yespo API request [id]: METHOD URL no yes
    Yespo API response [id]: HTTP status /path in N ms no yes
    Yespo Monitoring [EVENT_CODE] lines for success events no yes, with the event data (domain, batch, offset, total and similar counters)
    Yespo Monitoring [EVENT_CODE] lines for errors yes yes, with the event data
    Request bodies (emails, names, orders), headers, API key never never

    With debug off a healthy store therefore writes few lines, so an almost empty log is not a sign of a problem. The requestBody field is cut out of the event data before it is written. An error response of Yespo that is not valid JSON is written at debug level only, so it appears only with debug on.

  • Remote monitoring: significant lifecycle events (onboarding steps, import start and finish, rejected contacts, bulk failures) are also reported to Yespo's plugin monitoring endpoint (https://events.yespo.io/logs/v1/plugin) with a stable event code, so Yespo support can see what happened without access to the store. Errors are reported for the whole life of the plugin. Success events are reported during onboarding, and for every web tracking event sent from the backend (StatusCart, PurchasedItems, CustomerData, AddToWishlist) for as long as the plugin runs.

  • Personal data in remote monitoring: the success and error reports of a backend tracking event contain the full event and Yespo's response: customer ID, email, name, phone, the sc cookie value, cart or order lines and the order number. So this data goes to events.yespo.io as well as to the tracker. Turning off web tracking, or the single event, stops both.

  • Admin: the connection page shows the status of each step and the live Contacts / Orders counters; admin notices report a disabled or paused integration, a growing backlog and a missing consumer.

Security and privacy

  • The API key is encrypted at rest with Magento's encryptor and is read only on the server.
  • Queue payloads that are kept for retry are stored encrypted.
  • Contact and order sync send nothing until Data sync is switched on.
  • Web tracking does not depend on Data sync and is enabled by default. Once the store is connected and the site script works, it sends visitor behaviour and shopper data (email, name, phone, cart, purchases) to Yespo, see Web Tracking. To prevent this, switch off Enable Web Tracking.
  • Custom option text and uploaded files of order items are never sent.
  • GDPR: with Contact Deletion Mode = GDPR Erase a deleted customer is erased permanently in Yespo. With the default Manual Delete the contact is only removed and stays linked to its orders.
  • Disconnecting or uninstalling the module never calls Yespo to delete anything, see Disconnecting.
  • The module ships a Content Security Policy allowlist for the Yespo hosts (etc/csp_whitelist.xml).
  • Admin access is controlled per tab by ACL resources.
  • Observers never throw into the storefront; every observer catches \Throwable and logs it.

Yespo terms

The module's license covers its code only. The use of the Yespo service is governed by the Terms of Use, the Privacy Policy and the Data Processing Agreement. Part of the service is free, the rest is paid: pricing.

  • The site and Web Push scripts wait for cookie consent only with Magento's Cookie Restriction Mode enabled (off by default); the module does not read third-party consent banners.
  • The Yespo site script does not ask for cookie consent itself. If you use a third-party consent tool, configure it to block the Yespo scripts and verify the result. Without the sc cookie, backend web tracking events are not sent.
  • The historical import sends every customer of the connected website; subscription status is not sent.
  • Data already sent stays in Yespo after disconnecting or uninstalling the module.

Troubleshooting

Data sync stuck at "loading", counters never move. Almost always a queue consumer problem - see Queue consumers: check that cron runs and that cron_consumers_runner in env.php does not leave the yespo.* consumers out. Check bin/magento queue:consumers:list | grep yespo and var/log/yespo_cdp.log.

Admin notice: "AMQP queue ... has had no consumer listening for over 5 minutes". Clears by itself - it is checked every 5 minutes by the yespo_cdp_check_amqp_queues cron job, and clears as soon as a consumer reconnects or the queue drains to 0 messages. If it never clears, the queue really has a stuck message and no consumer - diagnose as above, it is not a UI bug.

HTTP 404 ... importstatus ... Cannot find import session status after a reconnect. A long-running consumer (Option B without --max-messages) still holds the old API key in memory. Restart the consumers.

Stale values sync (name and email update but not languageCode / timeZone). Same root cause: the consumer did not pick up a configuration change. Any admin Save Config, Connect, Disable integration or setup:upgrade bumps a poison pill that a --max-messages consumer picks up on its next message; a plain queue:consumers:start (no --max-messages) never checks it and needs a manual restart.

A historical import batch never finishes. The Check Bulk Import Sessions cron job (every minute) heals this on its own, see Error handling. Run Try again or bin/magento yespo:sync:customers afterwards.

Duplicated or orphaned consumers (consumers > 1 on a topic). The systemd unit is missing ExecStop. Add it, run daemon-reload, then clean the orphans once with pkill -f queue:consumers:start before restarting.

Invalid API key (401). Re-enter a valid key. If the integration was disabled, Disable integration and connect again; if the same key starts working, the status cron re-enables it by itself.

Integration paused after connection failures. Nothing to do: the recovery cron re-enables it within 5 minutes of Yespo answering again and sends the changes made during the pause. A historical import running at that moment waits on its current batch (no attempt is spent, the import status is not polled) and continues by itself after the recovery. var/log/yespo_cdp.log has the cause.

Tables missing after the first setup:upgrade (cron logs yespo_cdp_contact_retry doesn't exist). Run bin/magento setup:upgrade a second time and check bin/magento setup:db:status.

Where to look first: var/log/yespo_cdp.log. Search for the request id of the failing call.

Tracing an error

Errors and warnings are written with debug logging off, so a failed call can be found without it. See Logging and monitoring for the full list of what is written when.

  1. Find the failed call. grep "Yespo API error\|connection error\|slow response" var/log/yespo_cdp.log. Each line carries the request id [a1b2c3d4], the path (/api/v1/contacts), and the HTTP status. The start of Yespo's answer is added only with debug logging on (step 3). A status 0 or connection error means Yespo was not reached; 401 means the API key was rejected and the integration is switched off with the reason invalid_key.
  2. Follow it. grep "a1b2c3d4" var/log/yespo_cdp.log shows every line of that call. The module's own lines around it (Yespo CDP: ..., Yespo Monitoring [..._FAILED]) name the batch, customer or order it belonged to.
  3. Need the sequence or the whole answer? Switch Enable Debug Logging on, repeat the action, read the Yespo API request/response lines and the full body of the error, then switch it off again (the log is not protected by admin roles).
  4. Need to know what was sent? The log never holds request bodies. Look at the retry tables and the queue (queue_message) or reproduce against the local API mock.
  5. Nothing in the log at all? A failure that throws nothing leaves no line: an observer that did not fire, a message waiting in the queue, a consumer that is not running. Check bin/magento queue:consumers:list | grep yespo, the admin notices (backlog, missing consumer, stuck batch) and the status of each step on the connection page.

Disconnecting and uninstalling

Disable integration (same code path as bin/magento module:uninstall -r) resets the store to a fresh-install state:

  • deletes every core_config_data row under yespo_cdp*, yespo_cdp_web*, yespo_cdp_options*, yespo_cdp_contacts* and yespo_cdp_orders*, in all scopes;
  • deletes the yespo_cdp_* cron schedule history and the seven internal tables' rows;
  • purges still-queued yespo.* messages from queue_message and queue_message_status;
  • deletes the service worker file and the local log;
  • flushes the config and full_page caches and bumps the queue poison pill so any running consumer restarts clean.

The integration is stopped first (no tracking, sync or scripts) and the connection is removed last. If a step fails, the connection stays, the Account connection row shows the error with Disable integration to try again, and the error is shown in the admin. A service worker file that cannot be deleted does not block the disconnect: it is logged, and the router serves nothing without a connection. An onboarding request still running when Disable integration is clicked saves nothing afterwards.

It never touches Yespo's side: no API call deletes anything remotely (deleting a Web Push domain on Yespo's side would also drop its subscribers, which deactivating a plugin must not do). Data already sent to Yespo stays there.

To remove a module installed with Composer: bin/magento module:uninstall Yespo_Cdp -r. The command also removes the Composer package.

If the command stops at Removing code from Magento codebase: and does not finish, Composer is waiting for an answer that Magento does not show. The usual cause is that Magento runs Composer with its own home directory (var/composer_home) and cannot find your repo.magento.com keys, which are often only in ~/.composer/auth.json (a known Magento issue). The module data is already removed at this point. Stop the command with Ctrl+C and finish by hand:

composer remove yespo/module-cdp
bin/magento setup:upgrade
bin/magento cache:flush
bin/magento maintenance:disable

To avoid the hang next time, copy your Composer keys to where Magento looks for them (run from the Magento root):

mkdir -p var/composer_home
cp "$(composer config --global home)/auth.json" var/composer_home/auth.json
chmod 600 var/composer_home/auth.json

The file holds secrets: never commit it. To see the error instead of a hang, run the command as COMPOSER_NO_INTERACTION=1 bin/magento module:uninstall Yespo_Cdp -r.

To remove a module installed manually in app/code (module:uninstall refuses it):

  1. Click Disable integration if the store is connected.

  2. Disable the module and drop its tables, while the code is still in place:

    bin/magento module:disable Yespo_Cdp
    bin/magento setup:upgrade
  3. Delete app/code/Yespo/Cdp. Do not delete it before step 2: without its db_schema_whitelist.json Magento keeps the tables.

  4. Run bin/magento setup:upgrade again, then bin/magento cache:flush. In production mode also run bin/magento setup:di:compile and bin/magento setup:static-content:deploy.

  5. Remove any yespo.* consumers from your systemd units or the cron_consumers_runner list in app/etc/env.php.

Development and testing

# unit tests
vendor/bin/phpunit -c app/code/Yespo/Cdp/Test/Unit/phpunit.xml

# integration tests (need the Magento integration test environment and a test database)
cd dev/tests/integration
php -d memory_limit=-1 ../../../vendor/bin/phpunit -c phpunit.xml --filter 'Yespo.Cdp.Test.Integration'

# Magento coding standard
vendor/bin/phpcs --standard=Magento2 --severity=10 --extensions=php,phtml app/code/Yespo/Cdp

# static analysis
vendor/bin/phpstan analyse --level=8 app/code/Yespo/Cdp
  • The unit and integration suites run on PHPUnit 9.5, 10.5 and 12.5, which cover Magento 2.4.4 to 2.4.9.
  • Integration tests run in a transaction that is rolled back. Some of them need customers and orders of website 1 in the test database and are skipped when it has none.
  • Architecture rules: no ObjectManager, no direct HttpClient use outside Model/Api, no API calls in observers (queue only), every observer catches \Throwable.
  • Code follows the Magento coding standard and PHPStan level 8; every public method is typed and documented.

Triggers, queue topics and API calls

What each Magento hook does, which queue topic it publishes to, and which Yespo endpoint the consumer finally calls. Every observer is wrapped in catch (\Throwable), makes no network call, and skips websites other than the connected one (WebsiteScopeValidator). Hosts: https://api.yespo.io (yespo_cdp_options/integration/base_url), tracking https://tracker.yespo.io/api/v2 (tracker_url), plugin monitoring https://events.yespo.io/logs/v1/plugin (log_url).

Magento hook -> topic -> consumer -> Yespo

Hook (etc/events.xml) Observer Topic Consumer Yespo call
customer_save_after CustomerUpdateObserver yespo.contact.sync ContactConsumer::processSyncMessage POST /api/v1/contact; POST /api/v1/contacts when reset_absent is set (a synced value became empty, a name became invalid or the default address changed)
customer_address_save_before/after, customer_address_delete_before, customer_address_delete_commit_after CustomerAddress*Observer yespo.contact.sync same same
customer_delete_after CustomerDeleteObserver yespo.contact.delete ContactConsumer::processDeleteMessage DELETE /api/v1/contact?externalCustomerId={id}[&erase=true]
Customer, Address, CustomerComposite::importData (System > Data Transfer > Import) Plugin\ImportExport\SyncImportedCustomers yespo.contact.sync, yespo.contact.delete ContactConsumer::processSyncMessage, processDeleteMessage same as customer_save_after / customer_delete_after
sales_order_save_after OrderObserver yespo.order.sync OrderConsumer::processSyncMessage POST /api/v1/orders (one order)
OrderAddressRepositoryInterface::save Plugin\Sales\SyncEditedOrderAddress yespo.order.sync OrderConsumer::processSyncMessage POST /api/v1/orders (one order)
sales_order_place_after + sales_order_save_commit_after OrderPlaceFlagObserver + OrderPlacedObserver yespo.event.publish EventConsumer::process POST {tracker_url} event PurchasedItems
customer_save_after, address save (the customer's own storefront session or REST / GraphQL token) same observers yespo.event.publish EventConsumer::process POST {tracker_url} event CustomerData
customer_login CustomerLoginObserver yespo.event.publish EventConsumer::process POST {tracker_url} event CustomerData
sales_quote_save_commit_after CartChangeObserver yespo.event.publish EventConsumer::process POST {tracker_url} event StatusCart
Wishlist::addNewItem Plugin\Wishlist\TrackAddedItem yespo.event.publish EventConsumer::process POST {tracker_url} event AddToWishlist

Conditions that suppress a message: integration disabled or website not connected; for contacts and orders, Data sync off (the change is recorded in yespo_cdp_pending_* and replayed through yespo.pending.resync after Data sync is switched on again); for tracking events, yespo_cdp_web/events/enabled and the per-event switch off, or an assisted session (Login as Customer, admin area). Contact messages carry customer_id, storeId; order messages order_id, storeId; tracking messages are the full event body (GeneralInfo.eventName, siteId, datetime, identity fields, cookies.sc, plus the event block).

Other topics

Topic Published by Consumer Yespo call
yespo.contact.bulk_batch EnableDataSync, RetryDataSync, yespo:sync:customers, the previous batch ContactBulkBatchConsumer::processBatch POST /api/v1/contacts (page <= 2000), publishes the next batch
yespo.order.bulk_batch end of the contacts import, yespo:sync:orders, the previous batch OrderBulkBatchConsumer::processBatch POST /api/v1/orders (page <= 1000), publishes the next batch
yespo.pending.resync EnableDataSync, connection recovery PendingResyncConsumer::process re-publishes yespo.contact.sync, yespo.contact.delete, yespo.order.sync

Admin and cron calls

Trigger Code Yespo call
Connect Controller/Adminhtml/Setup/SaveApiKey GET /api/v1/account/info
Site domain step ConnectDomain POST /api/v1/site/domains, GET /api/v1/site/script
Web Push step ConnectWebPush POST /api/v1/site/webpush/domain, GET /api/v1/site/webpush/script
Cron yespo_cdp_sync_domain_status SyncDomainStatus GET /api/v1/account/info, GET /api/v1/site/domains, GET /api/v1/site/webpush/domains
Cron yespo_cdp_recover_connection RecoverConnection GET /api/v1/account/info
Cron yespo_cdp_check_contact_bulk_sessions CheckContactBulkSessions GET /api/v1/importstatus/{sessionId}
Contact mapping (custom fields, groups) CustomFieldRegistry, Config\Source\Groups GET /api/v1/additionalfields, GET /api/v1/groups
Lifecycle events MonitoringLogger POST {log_url}

Cron jobs yespo_cdp_retry_contact_sync, yespo_cdp_check_queue_backlog, yespo_cdp_check_stuck_messages and yespo_cdp_check_amqp_queues make no Yespo call; they re-publish retries and raise admin notices. Schedules are in Cron jobs and etc/crontab.xml.

Yespo API reference

Calls made by the module, with Yespo's reference page for each.

Purpose Request Reference
Check the API key GET /api/v1/account/info getaccountinfo
Register the store domain POST /api/v1/site/domains createdomain
List registered domains GET /api/v1/site/domains createdomain
Download the site script GET /api/v1/site/script getscript
Register the Web Push domain POST /api/v1/site/webpush/domain addwebpushdomain
Download the Web Push service worker GET /api/v1/site/webpush/script getwebpushscript
Create or update one contact POST /api/v1/contact addcontact
Create or update contacts in bulk POST /api/v1/contacts contactsbulkupdate
Delete or erase a contact DELETE /api/v1/contact?externalCustomerId={id}[&erase=true] deletecontact
Create or update orders in bulk POST /api/v1/orders ordersbulkinsert
Read the status of a bulk import GET /api/v1/importstatus/{sessionId} getimportsessionstatus
Send backend tracking events POST https://tracker.yespo.io/api/v2 Behaviour data via REST API

Further reading on Yespo's side:

Support and license