Behavioral Tracking Consents Synchronization Using Web Services

Modified on: Tue, 30 Jun, 2026 at 10:34 AM

The Contacts.Merge method allows you to synchronize different contact data by adding new contacts or modifying existing contact data. This method is used, among other things, to synchronize contact consent statuses for behavioral tracking from an external system (website, CRM, application) to a Dialog Insight project. For example, a visitor to your website fills out a form and checks a box to give their consent to be tracked. The form information regarding consent is transferred with a call to the Contacts.Merge method. This article presents different ways to write the query depending on the scenario.

→ Contacts.Merge Method (Canadian Platform)
→ Contacts.Merge Method (French Platform)


Recommended Reading


Precisions About the Consent Status

The value associated with the consent indicates if the contact consents (1) or does not consent (0). True/false is also accepted.
"hasTrackingConsent": "1"

The date  indicates when the status was added or updated. The date format must be AAAA.MM.DD.
"dtTrackingConsent": "2026.10.24"


Case 1: Creating Subscribers

Goal: Create new contacts in Dialog Insight, including the consent and basic info (first name and last name).

    "AuthKey": {
         "idKey": 5335,
         "Key": "abcdefghijklmnopkrstuvwxyz"
    },
     "idProject": 123456,

//In the example, 2 contacts are created and their status for behavioral tracking is added.
    "Records": [
        {
            "ID": {
                 "key_f_EMail": "claire@domain.com"
            },
            "Data": {
                 "f_FirstName": "Claire",
                 "f_LastName": "Brown",
                 "hasTrackingConsent": "1",
                 "dtTrackingConsent": "2026.10.24"
            }
        },
        {
            "ID": {
                "key_f_EMail": "marc@domain.com"
            },
            "Data": {
                 "f_FirstName": "Marc",
                 "f_LastName": "Tremblay",    
                 "hasTrackingConsent": "1",
                 "dtTrackingConsent": "2026.10.24"
            }
        },
    ],

    "MergeOptions": {
        "AllowInsert": true,
        "AllowUpdate": false,
        "SkipDuplicateRecords": false,
        "SkipUnmatchedRecords": false,
        "ReturnRecordsOnSuccess": false,
        "ReturnRecordsOnError": false,
        "FieldOptions": null
    }
}
// You must set AllowInsert to true to allow new contact creation.



Case 2: Consent Preferences Update

Goal: Adding consent status for an existing contact, limiting the data to the consent (to avoid overwriting data in the contact profile). 

    "AuthKey": {
         "idKey": 5335,
         "Key": "abcdefghijklmnopkrstuvwxyz"
    },
     "idProject": 123456,

// In this example, we update 3 contacts. 
// Claire and Marc accept behavioral tracking (1), while Paul refuses (0).
    "Records": [
        {
            "ID": {
                "key_f_EMail": "claire@domain.com"
            },
            "Data": {
                "hasTrackingConsent": "1",
                "dtTrackingConsent": "2026.10.24"
            }
        },
        {
            "ID": {
                "key_f_EMail": "marc@domain.com"
            },
            "Data": {
                "hasTrackingConsent": "1",
                "dtTrackingConsent": "2026.10.24"
            }
        },
        {
            "ID": {
                "key_f_EMail": "paul@domain.com"
            },
            "Data": {
                "hasTrackingConsent": "0",
                "dtTrackingConsent": "2026.10.24"
            }
        },
    ],

    "MergeOptions": {
        "AllowInsert": false,
        "AllowUpdate": true,
        "SkipDuplicateRecords": false,
        "SkipUnmatchedRecords": false,
        "ReturnRecordsOnSuccess": false,
        "ReturnRecordsOnError": false,
        "FieldOptions": null
    }
}
//You must set AllowUpdate to true for the existing contacts to be updated. 



Case 3: Full Synchronization

Goal: Create new contacts and modify data from existing contacts.

    "AuthKey": {
         "idKey": 5335,
         "Key": "abcdefghijklmnopkrstuvwxyz"
    },
     "idProject": 123456,

// In this example, 2 contacts (Claire and Marc) are created and accept behavioral tracking.
// Paul, an existing contact refuses behavioral tracking.
    "Records": [
        {
            "ID": {
                 "key_f_EMail": "claire@domain.com"
            },
            "Data": {
                 "f_FirstName": "Claire",
                 "f_LastName": "Brown",
                 "hasTrackingConsent": "1",
                 "dtTrackingConsent": "2026.10.24"
            }
        },
        {
            "ID": {
                "key_f_EMail": "marc@domain.com"
            },
            "Data": {
                 "f_FirstName": "Marc",
                 "f_LastName": "Tremblay",    
                 "hasTrackingConsent": "1",
                 "dtTrackingConsent": "2026.10.24"
            }
        },
        {
            "ID": {
                "key_f_EMail": "paul@domain.com"
            },
            "Data": {
                "hasTrackingConsent": "0",
                 "dtTrackingConsent": "2026.10.24"
            }
        },
    ],

    "MergeOptions": {
        "AllowInsert": true,
        "AllowUpdate": true,
        "SkipDuplicateRecords": false,
        "SkipUnmatchedRecords": false,
        "ReturnRecordsOnSuccess": false,
        "ReturnRecordsOnError": false,
        "FieldOptions": null
    }
}
// You must set AllowInsert to true to allow new contact creation.
// You must set AllowUpdate to true for the existing contacts to be updated.

Good Practices

  • Limit the data included in the call to the consent (for updates). 
  • Verify in the contact list if the import was processed correctly.
  • Use the NullHandling property to manage empty values.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article