TrustCommander
Create the Click2Buy vendor
Add a vendor with the following settings (see the TrustCommander documentation on managing vendors):
| Field | Value |
|---|---|
| ID | click2buy |
| Name | click2buy: exactly this value, in lowercase |
| Policy URL | https://click2buy.com/privacy-policy/ |
| Description | See below |
text
Click2Buy uses your IP address to locate you and show retailers near you.Publish your changes, then contact your Customer Success Manager to enable the consent feature on your widgets.
Check your configuration
Once your changes are published, run this code in the browser console on your website to check that the Click2Buy vendor is set up correctly:
js
function checkConsentVendors() {
let trustCommanderConsent = false;
// Check TrustCommander
if (typeof tC !== 'undefined') {
console.log("[TrustCommander] SDK detected ✅");
try {
const vendors = tC.privacy?.includedVendors || {};
const vendor = Object.values(vendors).find(vendor => vendor.label === 'click2buy');
console.log(`[TrustCommander] Click2Buy vendor found: ${vendor ? "✅ Yes" : "❌ No"}`);
if (vendor) {
const consents = tC.privacy.getConsent()?.consent || {};
trustCommanderConsent = consents.vendors?.[vendor.id]?.status === true &&
vendor.categories.every(categoryId => consents.categories?.[categoryId]?.status === true);
console.log(`[TrustCommander] Click2Buy consent: ${trustCommanderConsent ? "✅ Granted" : "❌ Denied"}`);
}
} catch (error) {
console.error("[TrustCommander] Error checking consent ❌", error);
}
} else {
console.log("[TrustCommander] Not found ❌");
}
return { trustCommander: trustCommanderConsent };
}
// Run the check
checkConsentVendors();