Customer Data Platform (CDP) Webtag supports sending custom attributes on the standard CDP entities or sending custom events based on your business needs.
CDP must be configured with these custom attributes before they can be part of the event payload of the webtag. Attributes can include information that is related to the standard entities on your website. For example, the payment method used by customers for their transactions.
Important
If you are unsure whether custom attributes are configured in CDP, contact your CDP team and do not try to implement those attributes in your installation of the webtag. This could lead to API errors on your pages, with no events being sent to CDP.
Sending custom attributes on standard entities
Send information to the webtag only if it is the source of truth for that data. Data can be overwritten if it comes from multiple sources because CDP always takes the latest values regardless of the data source.
Events, Customer, Transaction, Target entities
For the following example, assume that you are implementing a custom attribute named “paymentMethod” with a value of “Visa” on a transaction entity.
All the standard entities implemented by the SDK models support custom attributes. This is an example of the code implementation:
<script>
// Define the transaction
var currentTransaction = $A1.Transaction({
SourceTransactionNumber: "WEBORDER-789",
SourceOrganizationNumber: "ORG098",
type: “Purchase”,
saleRevenue: 195.00,
discount: 20.00,
tax: 19.50,
paymentMethod: "Visa"
});
// Attach the transaction to the "checkout" event (assuming the customer and the transaction items have already been defined earlier)
var checkoutEvent = $A1.Event("checkout", {
customer: currentVisitor,
transaction: currentTransaction,
targets: [item1, item2],
...
});
</script>