Docs

Groundhogg Integration

3 min readUpdated June 21, 2026

Groundhogg is a self-hosted WordPress CRM and marketing automation plugin. WP Smart Consent integrates with it via Groundhogg’s native PHP API — no external API key or internet connection required. The integration runs entirely on your server.

Enabling the Integration#

In the WP Smart Consent dashboard, go to CRMs & ESPs, find the Groundhogg card, open the Connection tab, and toggle it on. Groundhogg must be installed and active on the same site.

A screenshot of the Groundhogg WordPress CRM plugin dashboard. The status is "Inactive." The "Connection" tab is selected with an "Enabled" toggle switch (off). A message explains no API is needed. A green "Save Groundhogg" button is at the bottom.

Custom Fields#

The Custom fields tab lets you map WPSC data fields to Groundhogg contact meta keys. Add a row, select the WPSC source field on the left, and enter the Groundhogg destination key on the right. If the destination key matches a native Groundhogg contact field (see Field Mapping below), the value is written directly to that field. Any other key is stored as contact meta.

Screenshot of the Groundhogg WordPress CRM interface. The "Custom fields" tab is selected. There’s a button labeled "Add Groundhogg custom field" and a green "Save Groundhogg" button at the bottom. The plugin status at top right is "Inactive.

Field Mapping#

The Field mapping tab maps WPSC fields to Groundhogg’s native contact field names. Supported native destination keys include: primary_phone, mobile_phone, company_name, company_address, company_phone, job_title, street_address_1, street_address_2, city, region, postal_zip, country, lead_source, source_page, marketing_consent, optin_status, time_zone, ip_address, birthday, and tags. Any destination key not in this list is stored as contact meta automatically.

Screenshot of the Groundhogg WordPress CRM interface, showing the "Field mapping" tab. It displays mapped fields such as primary_phone, mobile_phone, company_name, job_title, and address fields. "Save Groundhogg" and "Add mapping" buttons are at the bottom.

How It Works#

WP Smart Consent calls \Groundhogg\generate_contact_with_map() with the contact data and a field map array. If a contact with the same email already exists they are updated rather than duplicated.

The contact’s optin_status is set based on the opt-in state. A ticked checkbox creates the contact as CONFIRMED (status 2) — explicit consent was given. A contact received via Send on unchecked is created as UNCONFIRMED (status 1) regardless of other settings. The marketing_consent field is set to true or false to match.

You can override the optin status at the code level using the wpsc_groundhogg_optin_status filter, and modify the full payload using wpsc_groundhogg_contact_payload.

Options#

The Options tab has three settings.

Update existing contacts — controls whether an existing Groundhogg contact matched by email is updated on each opt-in.

Send on unchecked — when enabled, contacts are forwarded to Groundhogg even when the checkbox was not ticked, with UNCONFIRMED status.

Tags — a comma-separated list of tag names or numeric tag IDs to apply to every contact. Groundhogg creates tags by name automatically if they do not exist yet. Tags can also be filtered via wpsc_groundhogg_tags.

A screenshot of the Groundhogg WordPress CRM options tab. It shows toggles for "Update existing contacts" and "Send on unchecked," both off, a text field for tags with the placeholder “e.g. wpsc, newsletter, checkout,” and a green "Save Groundhogg" button.

Troubleshooting#

Contact not appearing — confirm the integration is enabled and that \Groundhogg\generate_contact_with_map is available. If Groundhogg is active but the function is missing, confirm you are running a version of Groundhogg that includes this function.

Custom field values not saving — confirm the destination key exactly matches the Groundhogg contact field name or meta key. Native field names are listed above. Anything else goes to meta.

Tags not applied — tags accept names or numeric IDs as a comma-separated string. Check the Groundhogg contacts tag list to confirm the tag was created and applied. Use the WPSC Logs tab to confirm the opt-in event fired.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only