Optional Event Callbacks for GDPR non-TCF Web Implementation (Legacy)
In this article we will cover the following for event callbacks that can be set up in your organization's client configuration code snippet during a GDPR non-TCF web implementation:

Available Event Callbacks

In the table below, please find the event callbacks that Sourcepoint supports for a GDPR non-TCF web implementation:
Event Callback
Description
onMessageReady
Event fires when a message is about to display. Will fire for Privacy Managers since they can also be used as First-Layer Messages
onMessageChoiceSelect
Event fires when a call-to-action button in a message has been clicked. The callback receives two integers. The first is the choice_id and it represents the id value of the choice selected. The second is the choice_type_id which is the ID of the type of choice clicked. Click here for a list of Choice Type IDs.
onPrivacyManagerAction
Event fires when a button in a Privacy Manager has been clicked. The possible values for the string returned to the function are SAVE_AND_EXIT or CANCEL.
onMessageChoiceError
Event fires when there is an error in the message delivery process. A brief description of the error is returned.
onConsentReady
Event fires when consentUUID or eu-consent value is ready.
onPMCancel
Event fires when a user hits the cancel button of the Privacy Manager.
onMessageReceiveData
Event fires when a message is displayed to the user and sends data about the message and campaign to the callback. The data sent to the callback will be in the following format:
{ "message_url":"https://notice.sp-prod.net?message_id=12345", "msg_id":"12345", "prtn_uuid":"6e769cbb-0adc-4ac2-b91c", "msg_desc":"Consent Message 9.20.2019", "cmpgn_id":"39599", "bucket":"49", "uuid":"fa3db7d9-3258-46f1-8386-97ce2b4a5249" }
onSPPMObjectReady
Event fires when the Privacy Manager is ready to be displayed on the page. It can be used to notify on-page functions that the Privacy Manager is now available to be displayed using the Sourcepoint plug and play javascript code.

Consent Type ID Descriptions

Choice Type ID
Description
1
The user has chosen to view instructions on how to whitelist a site
2
The user has chosen to opt into ad recovery (no longer used)
3
The user has chosen to view a directly sold video instead of disabling adblockers (requires a separate agreement)
4
The user has chosen to view custom content in an iframe
5
The user has chosen a option to redirect to another page
6
The user has chosen to continue with adblockers enabled
7
The user has chosen a micropayment option (requires a separate agreement)
9
The user has selected an option tied to custom javascript on the site page
10
The user has chosen to view a video provided by Welect (requires a separate agreement)
11
The user has chosen the "Accept All" option in a consent message
12
The user has chosen to view a Privacy Manager (consent preferences) UI.
13
The user has chosen the "Reject All" message from a consent message
14
Samba Video (requires separate agreement with Samba and Sourcepoint)
15
Dismiss button

GDPR non-TCF Implementation Example with Event Callbacks

1
<script>
2
window._sp_ = {
3
config: {
4
accountId: ACCOUNT_ID_HERE,
5
baseEndpoint: 'https://cdn.privacy-mgmt.com',
6
events: {
7
onMessageReady: function () {
8
console.log('onMessageReady')
9
},
10
onMessageChoiceSelect: function (choice_id, choice_type_id) {
11
console.log('onMessageChoiceSelect choice_id: ', choice_id);
12
console.log('onMessageChoiceSelect choice_id: ', choice_type_id);
13
},
14
onPrivacyManagerAction: function (pmData) {
15
console.log('onPrivacyManagerAction', pmData)
16
},
17
onMessageChoiceError: function (err) {
18
console.log('onMessageChoiceError', err)
19
},
20
onConsentReady: function (consentUUID, euconsent) {
21
console.log('onConsentReady')
22
console.log('consentUUID', consentUUID)
23
console.log('euconsent', euconsent)
24
},
25
onPMCancel: function () {
26
console.log('onPMCancel')
27
},
28
onMessageReceiveData: function (data) {
29
console.log('onMessageReceiveData', data)
30
console.log(JSON.stringify(data));
31
},
32
onSPPMObjectReady: function () {
33
console.log('onSPPMObjectReady')
34
}
35
},
36
targetingParams: {
37
test: 1
38
}
39
}
40
}
41
</script>
42
<script src="https://cdn.privacy-mgmt.com/messagingNoTcfApi.js" async></script>
43
Copied!
Last modified 6mo ago