<head> or Google Tag Manager, plus server events fired from WooCommerce’s order completion hooks.
For the full server-event field reference, deduplication behaviour, and error codes, see Server-Side Events.
Browser tracking
Method 1 — Paste the snippet in your theme
Add the tracking snippet to the<head> of every page. The safest place is your child theme’s functions.php via wp_head:
acct_a1b2c3d4 with your workspace ID — copy it from the Site ID card under Settings → Workspace → Settings & Integrations, or from the full snippet on the Tracking tab. Always copy the ID from the dashboard rather than retyping it. Use a child theme so the snippet survives parent-theme updates. Alternatively, use a plugin that injects code into <head> (e.g. WPCode).
Method 2 — Google Tag Manager Custom HTML tag
If your site is managed through GTM:- Create a new Custom HTML tag in GTM.
- Paste the snippet into the HTML field.
- Set the trigger to All Pages.
- Publish the container.
Server events
WooCommerce order completion hook
Send aconversion event when WooCommerce confirms payment. Add this to your child theme’s functions.php or to a site-specific plugin:
At least one of
anonymous_id, contact_id, or hashed_email is required. For guest checkouts, contact_id may be empty — hashed_email alone is sufficient. Include both when available for stronger identity matching.subdomain is required when calling api-v2.davazmysel.com directly. If you have configured a custom domain in Dáva (your own hostname registered in Domain Settings), omit subdomain. See Sending a single event for details.event_id and transaction_id are dedup keys — see Deduplication for the full priority chain. Use properties for any additional domain-specific facts (e.g. properties.sku, properties.plan).
woocommerce_payment_complete fires once payment is confirmed by the payment gateway. If you also need to fire on manual order status changes, use woocommerce_order_status_completed:
Hybrid setup (recommended)
A hybrid setup links the server conversion event to the visitor’s browser journey, attributing the purchase to the campaign that brought them in rather than storing it as an unmatched server event. The flow:- Your checkout page loads the Dáva snippet, which creates a browser session.
- Your checkout page JavaScript reads the session ID:
window.dava.sessionId - JavaScript writes the value into a hidden form field that posts with the checkout form.
- PHP reads the value from
$_POSTand saves it to the WooCommerce order as custom meta. - The
woocommerce_payment_completehook reads the meta and includes it asdava_session_idin the server event.
woocommerce_payment_complete hook then reads _dava_session_id from the order meta (as shown in the Server events section above) and passes it as dava_session_id in the event payload.
For more on journey joining and what happens when the session ID does not match, see Joining the visitor’s journey.
Next steps
- Server-Side Events reference → — full field table, dedup chain, batch endpoint, and error codes
- Install the tracking snippet → — snippet options, consent mode, and the Cloudflare Worker proxy install method