[Documentation](https://groundhogg.io/documentation/) » [Action Hooks](https://groundhogg.io/documentation/#doc-action-hooks)

# groundhogg/contact/merged

Published Tuesday, June 9, 2026 · Last updated Tuesday, June 9, 2026

Fires after two contact records have been merged. The primary contact has absorbed all data from the secondary, which has been deleted.

```

do_action( 'groundhogg/contact/merged', $contact, $other );
```

You will receive the primary (surviving) `Contact` object as the first argument, and the deleted secondary `Contact` object as the second.

## Example

```

add_action( 'groundhogg/contact/merged', 'my_extension_sync_merge', 10, 2 );

/**
 * Merge the two records in an external CRM after Groundhogg merges the contacts.
 *
 * @param \Groundhogg\Contact $contact The surviving contact.
 * @param \Groundhogg\Contact $other   The deleted contact.
 *
 * @return void
 */
function my_extension_sync_merge( $contact, $other ) {
    $primary_id   = $contact->get_meta( 'external_crm_id' );
    $secondary_id = $other->get_meta( 'external_crm_id' );

    if ( $primary_id && $secondary_id ) {
        my_extension_api_request( 'POST', '/contacts/merge', [
            'primary'   => $primary_id,
            'secondary' => $secondary_id,
        ] );
    }
}
```
