Skip to content

Contact sync

Switch: Contact sync. Settings: Contact sync tab.

Contact sync tab

Keeps bluefox contacts up to date with WordPress user and WooCommerce customer data, so you can build segments in bluefox with tags and field conditions – for example "customers with more than 3 orders" or "no order in the last 90 days".

Which contacts

Option What happens
Only people who are already bluefox contacts (default, recommended) existing contacts are updated; people who are not in bluefox are skipped
All users and customers missing contacts are created too

A created contact is not on any list, so it receives no campaigns until it joins one.

GDPR

With All users and customers you send personal data of people who never signed up for your newsletter to bluefox. Use it only with a documented legal basis, and list bluefox.email as a processor in your privacy policy.

A contact is only synced if the email belongs to a WordPress user or has at least one paid order.

Fields

Each row of the Fields table is one bluefox contact field. Tick Sync, and change the bluefox field name if you like (A–Z, a–z, 0–9 and _).

Data Default name Type On by default
Full name (first + last name) name (fixed) string yes
First name firstName string yes
Last name lastName string yes
WordPress user ID wpUserId number yes
WordPress role wpRole string yes
Registration date registeredAt date yes
Number of orders orderCount number yes
Total spent totalSpent number yes
Last order date lastOrderDate date yes
Last order total lastOrderTotal number yes
First order date firstOrderDate date yes
Billing country billingCountry string yes
Billing city billingCity string yes
Billing phone billingPhone string no
Billing company billingCompany string no
Billing street address (address lines 1 and 2) billingAddress string no
Billing postcode billingPostcode string no
Billing state / county (code) billingState string no
Purchased product categories (comma-separated slugs) purchasedCategories string no
Customer type (customer / guest) customerType string yes

The fields from Number of orders down need WooCommerce. For registered customers and guests alike, the order count and total spent are calculated from their paid orders (processing or completed), minus refunds. Dates are sent as YYYY-MM-DD. Billing details come from the customer's account, or from the latest paid order for guests and empty account values; the phone, company and address fields are personal data and therefore off by default (since 1.1.0) – switch on only what you use, for example when moving from MailerLite, whose WooCommerce integration filled Phone, Company, Address, ZIP and State.

The fields must exist in bluefox, otherwise bluefox silently ignores the values. Save the settings, then click Create missing fields in bluefox.

  • name keeps its name, so {{contact.name}} works in templates. An existing name in bluefox is never cleared.
  • Only changed values are sent.

Tags

  • Add the wp-user tag to registered users.
  • Add the customer tag to people with at least one paid order.

Both are off by default. Tags are added to the existing ones; nothing is removed.

Purchased product tags

Since 1.1.0, WooCommerce only, off by default. Tag the buyers of chosen products, so you can build segments and campaigns for them – for example everyone who bought a starter kit gets the refill offer.

  1. Tick Tag contacts who bought one of the products below.
  2. Search the products in the picker: type at least two letters of the name or SKU. Only matching products are loaded, so it works on big stores too. Up to 200 products.
  3. Optionally change the Tag prefix (default bought-). The tag is the prefix plus the product's slug, e.g. bought-starter-kit.
  4. Save, then run Sync all existing users/customers now to tag people who bought before (see Backfill).

From then on, every paid order of a chosen product adds the tag with the automatic sync. Rules:

  • All paid orders of the person count, not only the latest ones.
  • A variation counts as its product: buying T-shirt – red, M gives the T-shirt's tag.
  • Tags are only added, never removed – also not after a refund or when you remove the product from the list.
  • Renaming a product's slug creates a new tag for later syncs; the old tag stays on the contacts.
  • With scope existing contacts only, buyers who are not bluefox contacts are not created.

Agents can find product IDs with cfbe/search-products and set the products with cfbe/update-settings (see AI agent access).

Automatic sync

With Automatic sync on (default), a contact is synced in the background about 30 seconds after:

  • a user registers or updates their profile, or a customer saves an address;
  • an order becomes processing, completed or refunded;
  • a signup is confirmed (cfbe_signup_confirmed).

Several changes to the same person within a few seconds are combined into one sync.

Backfill

To sync everyone who is already on the site, click Sync all existing users/customers now.

  • It runs in the background in short batches (at most 50 contacts or about 20 seconds each, below common PHP time limits), with a short pause between contacts to stay within the bluefox API limits. You can leave the page.
  • Registered users come first, then guest customers (billing emails of paid guest orders).
  • Built for big lists (since 1.1.0): every contact is saved as soon as it is done, and each batch leaves a watchdog behind – if the server stops a batch (time limit, error), it goes on from the last saved contact. Temporary bluefox errors (429 rate limit, 5xx, network) are retried with growing pauses instead of being counted; a rejected API key (401/403) or eight temporary errors in a row pause the run with the reason.
  • The tab shows a progress bar (users plus guest orders), the counts per result, speed and minutes left, and the last 20 errors with the bluefox response (masked email, HTTP status, message). It refreshes every few seconds.
  • Stalled? When nothing has happened for 5 minutes, the tab says why: the background queue did not run the next batch (WP-Cron disabled or too few visitors), or a batch was stopped. While the tab is open it keeps the sync going itself; Resume continues a paused or stalled run, Cancel stops it. For a lasting fix on sites without a working WP-Cron, set up a real cron job for wp-cron.php – or use WP-CLI, which has no time limit.

Contact sync → Sync all existing users/customers now.

# Preview the first 10 contacts without writing to bluefox
wp cfbe sync --dry-run --limit=10

# Sync everyone in the foreground
wp cfbe sync

See WP-CLI.

Limits

  • Deleting a WordPress user does not delete the bluefox contact, and changing an account email does not rename it. Clean these up in bluefox if needed.
  • Developers can add or change values with the cfbe_sync_contact_data filter and slow the backfill down with cfbe_sync_contact_pause_ms – see Hooks.