I have added the CDN script in the webpage. Passed consent and sending event on button click but data is not getting reflected in data cloud.
My schema:
{"records":[{"masterLabel":"Custom Form Page","developerName":"customFormPage","category":"Engagement","externalDataTranFields":[{"masterLabel":"category","developerName":"category","dataType":"Text","isDataRequired":true},{"masterLabel":"dateTime","developerName":"dateTime","dataType":"DateTime","isDataRequired":true},{"masterLabel":"deviceId","developerName":"deviceId","dataType":"Text","isDataRequired":true},{"masterLabel":"eventId","developerName":"eventId","dataType":"Text","isDataRequired":true,"primaryIndexOrder":1},{"masterLabel":"eventType","developerName":"eventType","dataType":"Text","isDataRequired":true},{"masterLabel":"sessionId","developerName":"sessionId","dataType":"Text","isDataRequired":true},{"masterLabel":"name","dataType":"Text","developerName":"attributesName","isDataRequired":false},{"masterLabel":"email","dataType":"Text","developerName":"attributesEmail","isDataRequired":false},{"masterLabel":"address","dataType":"Text","developerName":"attributesAddress","isDataRequired":false},{"masterLabel":"phoneNumber","dataType":"Text","developerName":"attributesPhoneNumber","isDataRequired":false}]}]}
And my send event function on button click:
<script>
SalesforceInteractions.init({
consents: [
{
provider: "One Trust",
purpose: "Tracking",
status: SalesforceInteractions.ConsentStatus.OptIn,
},
],
}).then(() => {
console.log("init success");
});
function test() {
//alert("clicked");
SalesforceInteractions.setLoggingLevel(5);
SalesforceInteractions.sendEvent({
interaction: {
name: "customFormData",
catalogObject: {
type: "Form",
id: "form-1",
attributes: {
name: "sumit singh",
},
},
},
});
}
</script>