---
title: "Reference — Egenverk Conversion Relay"
description: "Constants, filters, WooCommerce locations, Content Security Policy and caching rules for Conversion Relay."
canonical: https://egenverk.se/en/plugins/conversion-relay/docs/reference
lang: en
updated: 2026-10-14
alternate: https://egenverk.se/plugins/conversion-relay/docs/referens.md
---
# Reference

Egenverk Conversion Relay · v1.7.0 · WordPress 6.5+, WooCommerce 8.2+, PHP 7.4+ · Updated 2026-10-14

## Constants and environment variables

| Name | What |
| --- | --- |
| `EGENVERK_CONVERSION_RELAY_API_KEY` | The Conversions API key. As a constant in `wp-config.php` or as an environment variable. Takes precedence over the saved key and is never shown in the admin. |
| `CONVERT_RELAY_API_KEY` | The former name, still read. Rename it to the new name. |

The order is constant, then an environment variable of the same name and, last, the saved key. An explicitly empty value on the server takes precedence over the saved key.

```php
define( 'EGENVERK_CONVERSION_RELAY_API_KEY', 'your-key' );
```

## Filters

Callbacks still registered under the former `convert_relay_*` names run, but with a deprecation notice. Switch to the names below.

### egenverk_conversion_relay_capture_order

Decides whether a paid order counts as a purchase. Arguments:

- `$capture` (bool): `true`, or `false` when the order is a subscription renewal.
- `$order` (`WC_Order`): the order.

Return `false` to exclude the order, for example copies made by plugins that duplicate or split orders.

```php
add_filter(
	'egenverk_conversion_relay_capture_order',
	function ( $capture, $order ) {
		if ( $order->get_meta( '_my_copy_of_order' ) ) {
			return false;
		}
		return $capture;
	},
	10,
	2
);
```

The meta field in the example is only an example. Use the one your own plugin sets on the copies.

### egenverk_conversion_relay_allowed_origins

The origins allowed to send the browser's requests to the plugin, such as a refusal of consent. Arguments:

- `$origins` (array): origins such as `https://example.com`, that is scheme, host and any port, without a trailing slash. By default the store's home address and WordPress address.

Return the whole list. An origin must match the request's `Origin` exactly. A rejected origin is logged as a warning at most once an hour.

```php
add_filter(
	'egenverk_conversion_relay_allowed_origins',
	function ( $origins ) {
		$origins[] = 'https://shop.example.com';
		return $origins;
	}
);
```

## WooCommerce locations

| What | Where |
| --- | --- |
| Settings, validation and delivery | WooCommerce → Settings → Conversion Relay, tabs **Settings**, **Validation & log** and **Delivery status** |
| Log | WooCommerce → Status → Logs, source `egenverk-conversion-relay` |
| Queue | WooCommerce → Status → Scheduled Actions, group `egenverk-conversion-relay` |

The Plugins screen also has a **Settings** link to the plugin.

## Events

| Event | From | When |
| --- | --- | --- |
| `page_viewed` | Browser | Page view |
| `contents_viewed` | Browser | Product view |
| `items_added` | Browser | Add to cart |
| `checkout_started` | Browser | Checkout started, with the first 50 cart lines |
| `order_created` | Server | Confirmed purchase |

The purchase amount is the order total after discounts, including tax, shipping and fees. Stores with currencies outside ISO 4217 or with fractional quantities are not supported.

## Content Security Policy

If the site uses a Content Security Policy, add OpenAI's addresses to the existing one:

```text
script-src  https://bzrcdn.openai.com
connect-src https://bzrcdn.openai.com https://bzr.openai.com
img-src     https://bzr.openai.com
```

Keep your current nonce or hash policy. `unsafe-inline` is not needed.

## Page cache and CDN

The server reads consent and the ad click from the cookies of requests WooCommerce makes anyway. The page cache and any CDN must therefore not serve cached HTML to requests carrying these cookies, and must pass the cookies through to PHP:

- `wp_woocommerce_session_*`
- `woocommerce_items_in_cart`
- `wordpress_logged_in_*`

Otherwise pages are identical for every guest and can be cached. Purge the page cache after changing settings or updating the plugin.

## Resources

- [Product page](https://egenverk.se/en/plugins/conversion-relay)
- [Changelog](https://egenverk.se/en/plugins/conversion-relay/changelog)
- [Docs](https://egenverk.se/en/plugins/conversion-relay/docs)
- Previous: [Troubleshooting](https://egenverk.se/en/plugins/conversion-relay/docs/troubleshooting)
