Permission: Campaign entities
The Preference Center message JavaScript code is a snippet that is added to a web property and allows an end-user to resurface a Preference Center message. Using this link/button, end-users can directly manage their marketing preferences on an ongoing basis.
- Configure resurface Preference Center message Javascript code
- Implement resurface Preference Center message Javascript code
Configure resurface Preference Center message Javascript code
The code snippet to resurface your Preference Center message uses a loadPreferenceCenter
function to pass the Preference Center message ID and the end-user's email address.
Retrieve the Preference Center message ID by clicking Messages on the left-hand panel and selecting Preference Center.
Use the property field in the upper right-hand corner to select a property for which you will resurface a Preference Center message.
Navigate to your Preference Center message in the list and copy the ID inline with the Preference Center message name.
In addition to the Preference Center message ID, your organization will need a way to pass your end-user's email address to the function. This argument is required as every end-user's Preference record stored by Sourcepoint is associated with that end-user's email address.
Format the resurface Preferences message Javascript code so it adheres to the following:
window._sp_.preferences.loadPreferenceCenter(PREF_MSG_ID, 'USER_EMAIL')
Implement resurface Preference Center message Javascript code
Attach the Preference Center message JavaScript code to an event handler on your property. Most organizations who implement the JavaScript code on their page will attach the function to the onclick
event of a page element.
<button onclick="window._sp_.preferences.loadPreferenceCenter(28458, 'test@email.com')">Marketing Preferences</button>
Comments
0 comments