Single Page Application Functions
When implementing on a single page application, you should include the isSPA parameter in your client configuration script and set the value to true.
1
//Example
2
window._sp_queue = [];
3
window._sp_ = {
4
config: {
5
accountId: 1584,
6
baseEndpoint: 'https://cdn.privacy-mgmt.com',
7
ccpa: { },
8
gdpr: { },
9
propertyHref: 'https://www.testdemo.com',
10
authCookie: 'test_uuid',
11
campaignEnv: 'stage',
12
isSPA: true,
Copied!
Including the isSPA parameter will confirm the implementation for a single page application and enable the use of the following functions:
Function
Description
window._sp_.executeMessaging();
Trigger the function in order to surface a message on a single page application. This function should be called on each (virtual) pageload.
Note: A message will only surface if your configured scenario dictates that a message should appear.
window._sp_.destroyMessages();
Trigger the window._sp_.destroyMessages() function to dismiss all messages.
Last modified 2mo ago
Export as PDF
Copy link