Linux 软件免费装
Banner图

CMLS - Customer Match List for Google Ads & Meta Ads

开发者 rwky
更新时间 2026年10月21日 03:48
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce google ads meta ads customer match cmls

下载

1.1.2 1.1.1 2.0.0 2.1.0 2.1.1

详情介绍:

Build Google Ads customer lists (Customer Match) from your WooCommerce orders: one CSV file per billing country, updated automatically on a schedule. Each country file has its own private, tokenized URL that Google Ads fetches straight from your WordPress site, with no third-party connector or API key — ideal for marketing teams that run per-country campaigns and want clean, single-market audience lists. The values are hashed with the same SHA-256 normalization used by both Google Ads Customer Match and Meta Ads Custom Audiences, so the same file can also be uploaded manually to Meta Ads Manager (see FAQ). Why this export? Not all purchases are captured by Google Ads tracking; periodic uploads of Customer Match lists help targeting and campaign performance. Even Google's automatic conversion-based customer lists (auto-enabled for eligible accounts from August 2026) only contain tag-tracked conversions — this plugin exports from the order database itself, so ad-blocked, phone, offline and historical orders are included too (see FAQ). The export reflects your order database as-is — applying your store's consent choices and legal requirements to it is your responsibility as the merchant (see the GDPR / privacy FAQ). Why per-country files? Marketing teams optimize Google Ads campaigns per country. Mixing a German audience into a Romanian campaign's match list pollutes the targeting. This plugin keeps each market in its own file. How it works
  1. You pick an audience window (all orders, the last 365 or 540 days, or any number of days) and the order statuses that count as a purchase.
  2. Every night the plugin rebuilds one CSV per billing country from the orders inside the window, hashing the customer fields. The new files replace the old ones in one step, so customers who stopped buying drop out and Google never fetches a half-written file. Feed URLs never change.
  3. Between rebuilds, a scheduled job (1, 6, 12, or 24 hours) appends new orders to the right country file. Orders that reach a selected status late (delayed payment confirmation, manual completion) are appended the moment they do, so they are never missed.
  4. Each country file is downloadable from a secret URL that you hand to your marketing team. They paste it into Google Ads Data Manager → HTTPS connector as a customer list, and Google fetches the latest version on its own schedule. A one-time manual upload works too.
  5. Optionally, value segments add extra files with only some of your customers, such as your top 10% by spend or big spenders who stopped buying, each with its own URL.
Features Admin Dashboard Settings WooCommerce → Marketing → Customer Match List. From there you can: WP-CLI

安装:

  1. Upload the plugin folder to wp-content/plugins/customer-match-list-google-ads (or install from the WordPress.org repository).
  2. Activate CMLS - Customer Match List for Google Ads & Meta Ads. WooCommerce must already be active.
  3. Go to WooCommerce → Marketing → Customer Match List.
  4. On the Settings tab, pick the update interval (1, 6, 12, or 24 hours), the audience window (new installs start at 540 days) and the order statuses.
  5. Build the files:
  6. From the admin — click Rebuild now on the Tools tab, or wait for the nightly rebuild. You can close the tab; it keeps running.
  7. From the shell — wp cmls rebuild.
  8. When the rebuild finishes, the Feeds tab shows one URL per country. Copy each URL and paste it into Google Ads Data Manager → HTTPS connector for the corresponding country's Customer Match list.

屏幕截图:

  • Settings: how often new orders are added, the audience window, the order statuses to export and the all-countries file.
  • Value segments: lists of your best customers by spend, number of orders and last order date, each with its own URL.
  • Health: checks for the feed URLs, schedule, file writes, storage, directory listing, nightly rebuild, hashing and list sizes, with the rows counted in every file.
  • Tools: Update now, Rebuild now, the one-time backfill, and the danger zone (reset the token, delete the files).

升级注意事项:

2.1.1 Readme and admin wording only; no functional changes. Feed URLs don't change. 2.1.0 New Health tab and optional all-countries file, plus fixes for token resets, backfills, phone numbers and lost schedules. Feed URLs don't change. 2.0.0 New audience window with a nightly rebuild, any order status, and value segments. Your files keep working exactly as before until you save the Settings tab once; then the nightly rebuild starts. Feed URLs don't change. 1.1.1 Naming and documentation release; no functional changes. 1.1.0 Feed URLs changed to end in .csv and hashing normalization was corrected — run "Delete all files & reset dedup", then re-run the backfill.

常见问题:

Why one file per country?

Marketing teams optimize Google Ads campaigns per country. Mixing audiences degrades match-rate signals and wastes budget on irrelevant impressions. Each country file is independent and can be wired into its own Customer Match list. Google's Data Manager pulls each URL on its own schedule, so you can refresh some markets without affecting others.

Can I get one file with every country?

Yes. On the Settings tab, tick Also offer one file with every country. The Feeds tab then lists an extra URL ending in /all.csv, after the country URLs. It holds the rows of every country file together, under one header, so it's always in step with them. A customer who ordered from two countries appears once per country, as in the country files.

How do I create a Google Ads customer list from a feed URL?

In Google Ads → Tools → Shared library → Audience manager, click + Create remarketing list → + Customer list and connect the HTTPS data source (step by step under "How do I add value segment URLs in Google Ads?" below; country URLs work the same way). Paste the country-specific URL from the plugin's admin page. Google Ads fetches the file on its own cadence; our plugin keeps the file fresh per the schedule you picked.

Google says it's turning on "conversion-based customer lists" — do I still need this plugin?

Yes — they complement each other. In 2026 Google began automatically enrolling accounts that use both Enhanced Conversions and Customer Match into conversion-based customer lists (enrollment emails went out from June 2026; data processing starts August 18, 2026). Those lists are built solely from what the Google Ads tag captures on your site from that point on: customers using ad blockers or declining your consent banner never enter them, and neither do phone, imported, or historical orders. This plugin builds Customer Match lists from the WooCommerce order database instead — every completed order, including full order history via backfill, split into one file per country, with a mailing-address fallback when an order has no email or phone. Keep both: attach the automatic conversion-based lists and the per-country lists this plugin feeds, and Google deduplicates matched customers on its side.

Does the file work with Meta (Facebook) Ads?

Yes. Meta Ads Custom Audiences use the same SHA-256 hashing of normalized (trimmed, lowercased) values, so a country CSV can be uploaded to Meta Ads Manager as a customer list — map the columns in Meta's upload screen. Note that Meta does not pull files from URLs; the pull-from-URL workflow is Google-specific, so on Meta use manual upload.

How long does the backfill take?

Roughly 10 seconds per 150,000–200,000 orders on typical hardware. The query path is direct SQL against wc_orders + wc_order_addresses (HPOS). For 1M+ orders the CLI is still the most reliable option because no PHP/web timeout applies; the admin Action-Scheduler-backed runner also handles 1M+ but each batch must complete within the host's PHP limit and if it does not then it won't finish.

What happens to orders with no billing country?

It shouldn't happen, since WooCommerce billing and shipping addresses are country-based, but if it does, the order is skipped. There is no correct file to route them to, and Google's per-country Customer Match campaigns can't use them anyway. The same applies to orders with an invalid country code.

What about orders with no email?

They get written. Google Customer Match accepts a row with any one of: email, phone, or full mailing address (first name + last name + zip). The plugin includes a row as long as one of those identifiers is present alongside a valid country. Deduplication is still single-column: it uses email when available, otherwise phone, otherwise the mailing address. Google handles cross-identifier deduplication on its side after matching to a Google account — so a customer who orders once with email + phone and again with only their phone will appear as two rows in the CSV but as one user in your Customer Match audience.

Will the same customer appear in multiple country files?

Yes — but only if they actually ordered from multiple countries!

I ran the backfill twice — why didn't it write more rows the second time?

This is by design, as every (email, country) pair is recorded the first time it's seen and never re-written. To regenerate everything from scratch (for example after toggling debug mode), click Tools → Rebuild now or run wp cmls rebuild. The rebuild starts from empty files and swaps them in when it's done; the URLs stay the same.

The feed URL contains "?rest_route="

Your site uses plain permalinks (Settings → Permalinks → Plain), so WordPress builds REST URLs with a query string. Google Ads rejects feed URLs with a query string, and the plugin shows a warning at the top of its page and on the Health tab. Pick any other permalink structure; the URLs then end in .csv. Update the URLs in Google Ads afterwards.

I get a 401 "REST API has been restricted to authenticated users" when I open the URL

Some security plugins ("Admin and Site Enhancements" / ASE has this option, Disable REST API, etc.) block all unauthenticated REST traffic. This plugin does not attempt to override those policies — that would be hostile to the security setting you deliberately chose. If you hit this error, whitelist the plugin's feed prefix in your security plugin's exclusion list: /wp-json/cmls/v1/feed/. Google Ads (and any other configured consumer) needs unauthenticated GET access to that prefix — the tokenized URL is the sole authentication mechanism.

Phone numbers — how reliable is the normalization without libphonenumber?

For most countries (RO, DE, UK, FR, ES, US, NL, BE, PT, IT mobile, …) it's correct. The routine accepts +, 00, the country's national trunk 0, and bare national numbers (using the order's billing country to fill in the dialing code). A number typed without + or 00 but starting with the dialing code's digits is read as already international. For countries whose numbers have a fixed length (India, Brazil, Norway, Poland, Singapore, Kazakhstan and 29 more) the plugin checks the length first, so an Indian mobile like 9123456789 becomes +919123456789, not +9123456789. Countries with variable-length numbers (Germany, Austria, Italy, Finland, …) keep the simpler rule. There is a known limitation for Italian landlines: in Italy the leading 0 is part of the national number, not a trunk prefix, so the routine may strip a digit it shouldn't. Italian mobile numbers (3xx) are fine. If you need strict accuracy across all locales, swap CMLS_Writer::normalize_phone() for a libphonenumber-based implementation.

Is WP-Cron reliable enough for the incremental updates?

WordPress's built-in cron is request-triggered: it only fires if someone hits the site. On low-traffic stores it may drift. For predictable runs, configure a real system cron that calls wp-cron.php every minute — standard WordPress practice and recommendation.

Can I disable hashing for debugging?

Yes. Add the CMLS_DISABLE_HASHING define to wp-config.php: define( 'CMLS_DISABLE_HASHING', true );

Does this support High-Performance Order Storage (HPOS) / Legacy Postmeta?

Yes. The plugin declares custom_order_tables compatibility and queries wc_orders + wc_order_addresses directly when HPOS is enabled. On classic (postmeta) storage it falls back to wp_posts + wp_postmeta with a single conditional-aggregation query per batch.

Does the plugin send any data outside my server?

The plugin makes no requests to third-party services — no analytics, no tracking pixels, no telemetry. All processing happens on your WordPress install. (The directory-listing safety check is a one-second request from your server to its own uploads URL — see the directory-listing FAQ.) However, the whole point of the workflow is that Google Ads (or any other consumer you configure) will pull the CSV from your site at the tokenized URL. Anyone in possession of that URL can retrieve a file containing:

  • SHA-256 hashes of the customer's email, phone, first name, and last name;
  • the customer's billing country and postal code in plaintext.
A value segment URL also shows that each customer in it belongs to that spend group (for example your top 10% by spend). Treat the tokenized URLs as secrets. If one leaks, use Reset token in the admin (or wp cmls reset-token) to invalidate all existing URLs and rename the files on disk. See the site's Privacy Policy page — this plugin registers suggested policy text via WordPress's Privacy tool.

Where are the files stored?

wp-content/uploads/customer-match-list-google-ads/customer-match-{hash}-{country}.csv, and customer-match-{hash}-seg-{id}.csv for value segments. During a rebuild the new files are written next to them with a .build suffix. The {hash} is a 16-character hex derived from the secret token, so filenames are not guessable. An index.php placeholder prevents listing if your host happens to have it enabled, and a deny-all .htaccess stops Apache from serving the files directly: the tokenized URLs read them through WordPress instead. nginx ignores .htaccess; there the unguessable names protect the files, or add location ^~ /wp-content/uploads/customer-match-list-google-ads/ { deny all; } to your server block. The all-countries file isn't stored: it's put together from the country files when Google fetches it.

What about directory listing?

The settings page does a one-second loopback HTTP request to the uploads directory URL (/wp-content/uploads/customer-match-list-google-ads/) when you open it, caches the result for an hour, and shows one of three banners:

  • Green — safe. The server returned 200/401/403/404 with no listing markers (typically because the bundled .htaccess denies access, the bundled index.php silence file is served, or the webserver explicitly blocks directory listings).
  • Red — exposed. The server returned 200 with Index of … or with our CSV filename prefix in the body. Anyone who guesses the directory URL can enumerate your country files. Fix it: Apache → Options -Indexes (or rely on the WordPress-shipped .htaccess); nginx → autoindex off; in the relevant location block.
  • Yellow — could not verify. The loopback request failed within the one-second budget (NAT / split-DNS / firewall blocking PHP self-calls). Open the URL shown in the notice in a private/incognito browser window — if you see a listing, restrict it; otherwise you're fine.
The check is cached for an hour and re-runs immediately if you click Re-check now.

What about Google's 540-day lookback window?

Google Ads keeps a Customer Match member for up to 540 days after that member was last uploaded or refreshed. Every time Google fetches your file, everyone in it is uploaded again, so a customer stays in the audience for as long as they are in the file, however old their orders are. That's what the audience window (Settings tab) is for. Every night the files are rebuilt from the orders inside the window, so a customer whose last order is older drops out of the file. Google then stops refreshing them, and they leave the audience at the latest 540 days after the last fetch that included them. New installs start at 540 days; pick "All orders" to keep everyone. The backfill date range only limits the initial history import; the audience window is what keeps the list trimmed afterwards. Sites upgraded from 1.x keep their current files, which only ever grow, until the settings are saved once. Saving turns on the nightly rebuild with the window you chose.

Can I include orders that aren't completed?

Yes. On the Settings tab, Order statuses lists every status, including custom ones added by other plugins (for example "Shipped"). Shortcuts pick Completed only, every paid status, or everything. The scheduled writer, the late-status hook, the admin backfill and the nightly rebuild all use your selection. The page warns you when you select a status where the customer hasn't paid (pending payment, on hold, failed, cancelled, refunded): those customers didn't buy, and failed orders often come from bots testing stolen cards. When an order leaves your selection (for example Completed → Refunded), the customer is removed at the next nightly rebuild, unless another of their orders still qualifies. For a one-off run with other statuses, use wp cmls backfill --statuses=processing,completed,on-hold or --all-statuses.

What are value segments?

Extra files that hold only some of your customers, each with its own URL to add in Google Ads as a separate Customer Match list. Turn them on under Value segments, then add up to 5 segments from a template or your own rules:

  • Minimum spend: a fixed amount in your store currency, or the top X% of customers by spend (follows your store as it grows).
  • Minimum orders: 2 or more for repeat buyers.
  • Last order: within the last N days, or not in the last N days (big spenders who stopped buying, for win-back campaigns).
Spend is a customer's total across their paid orders, either the order total or net sales (without tax and shipping), with refunds subtracted. It's counted over the audience window or over all orders ever, but a customer always needs an order inside the window to be in any file. If your orders use more than one currency, you can leave the other currencies out of the totals or convert them at rates you enter. Segments are recalculated at every nightly rebuild. Google doesn't serve lists with fewer than about 100 members, so the admin flags small segments. By default each segment is one file for all countries; you can split them by country.

How do I add value segment URLs in Google Ads?

Each segment URL is its own Customer Match list in Google Ads. Segment files are created at the nightly rebuild; click Tools → Rebuild now after adding a segment if you don't want to wait. The URLs are on the Feeds tab under Value segment URLs: one per segment, or one per segment and country if you split them by country. For each URL:

  1. In Google Ads, open Tools → Shared library → Audience manager.
  2. Click + Create remarketing list → + Customer list.
  3. Under Data source, choose Connect a new data source, pick HTTPS, accept the customer data policy and click Continue. Each URL needs its own connection.
  4. Paste the segment URL. Google requires a username and password, but the plugin doesn't use them (the token in the URL is the key), so enter any values.
  5. Choose customer contact information as the data type and map the columns. Email, Phone, First Name and Last Name are already SHA-256 hashed; Country and Zip are plain text, as Google expects. Don't add transformations.
  6. Name the connection and the list after the segment (for example "CMLS VIP – all countries"), confirm the policy and save.
Google takes a day or two to process a new list, then shows its size in Audience manager. It only counts customers it can match to a Google account, so a segment needs a few hundred rows to stay above the ~100 minimum. On Search and Shopping campaigns, add the lists in Observation mode and raise bids for your best customers. On Performance Max, add them to the asset group as an Audience signal. A lapsed high-value segment suits win-back campaigns. Editing a segment keeps its URL. Deleting a segment stops its URL, so remove the list in Google Ads too. Reset token changes every URL, country files and segments alike, and each Google Ads connection then needs the new one.

How is the deduplication table sized?

One row per unique (email_hash, country). At ~110 bytes per row, 1M unique customers across all countries is roughly 100 MB. While a rebuild runs, a second copy is filled next to it (plus a per-customer totals table when value segments are on), so plan for about twice that during the rebuild. The spare copies are emptied when it finishes.

Does it work on WordPress multisite?

Yes, activated per site: each site gets its own token, files, tables and schedule. Activate it from each site's Plugins screen; network activation is refused, because the setup has to run on every site. If an older version was network-activated, network-deactivate it and activate it per site. Uninstalling cleans up every site.

Will deactivating WooCommerce break it?

The plugin's admin page shows a notice and stops scheduling cron, but data isn't lost. Re-activate WC and the plugin resumes from the noted order. If you uninstall the plugin then the uninstall.php routine cleans up the option keys, database tables, and any generated files.

GDPR / privacy

The files contain hashed personal information (email, phone, name) and plaintext country + ZIP. Treat the directory and its access URLs as sensitive data! The plugin only creates files on your own server and does not read consent-management records: every order in the selected range is exported as-is. Whether a given customer may be included in an advertising audience — and whether Google or Meta may receive the file — depends on your store's consent setup and local legal requirements; applying them is your responsibility as the data controller. If a customer requests deletion under GDPR / similar:

  1. Delete or anonymize the WooCommerce order(s).
  2. Wait for the nightly rebuild, or click Tools → Rebuild now (wp cmls rebuild) — the deleted customer is gone from every file, value segments included.
Targeted per-row deletion isn't supported on purpose: the SHA-256 hashing is one-way and rebuilding from source is fast.

更新日志:

2.1.1 2.1.0 2.0.0 1.1.2 1.1.1 1.1.0 1.0.0