{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Trigger Preference Modal Box","type":"basic","slug":"trigger-preference-modal-box","excerpt":"","body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Trigger Preference Modal Box to let subscribers manage their notification preferences\"\n}\n[/block]\nThis is used to explicitly trigger the Preference Modal Box to let subscribers manage their notification preferences.\n\n##Parameters\n1. **triggerPreferences:** Command to trigger the Preference Modal Box.\n\n2. **settingsObject:**(Type: DictionaryStrings, Optional):\nContents of 'Settings Object' Dictionary:\n\n\ti. **Modal Title text:**(Type: String, Default: ‘You are subscribed to notifications from <account_company_name>’) - This is the general descriptive heading for the preference modal box.\n\t\n\tii. **Start Tracking Button text:** (Type: String, Default: ‘Start Usage Tracking’) - This button lets subscribers restart their usage tracking if previously stopped.\n\t\n\tiii. **Stop Tracking Button text:** (Type: String, Default: ‘Stop Usage Tracking’) - This button lets subscribers stop their usage tracking.\n\t\n\tiv. **Access Data Button text:**(Type: String, Default: ‘Access My Notifications Data’) - This button lets subscribers download all their data stored at VWO Engage's end from your account.\n\t\n\tv. **Delete Data Button text:**(Type: String, Default: ‘Unsubscribe and Delete All My Data’) - This button lets subscribers unsubscribe from Web Push Notifications on your website and delete all their data stored at VWO Engage's end.\n\n\n##Functionality\n1. **If User is not subscribed**: Does not show the Preference Modal Box.\n\n2. **If User is subscribed**: Shows the Preference Modal Box with the default values.\n\n3. **If User has blocked:** Does not show the Preference Modal Box.\n\n4. **If User has unsubscribed**: Shows the preference modal box. However, user can't take any action on this modal.\n\n\nExample code:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"window._pcq = window._pcq || [];\\n_pcq.push(['triggerPreferences']); //Calls Preference Modal Box with the default text\\n\\n\\nwindow._pcq = window._pcq || [];\\n_pcq.push(['triggerPreferences', 'Modal Title', 'Start Button', 'Stop Button', 'Access Data Button', 'Delete Data Button']); //Calls Preference Modal Box with the given custom texts\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n**Please Note: The order of the text parameters is important.**","updates":[],"order":999,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5b4d7fb12e3e7f0003d5d4e4","project":"55e58b63d101191900f30b13","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["55e58b65d101191900f30b17","55e58d16f493c11700584314","55e58d1bd101191900f30b1d"],"_id":"55e58b63d101191900f30b16","__v":3,"createdAt":"2015-09-01T11:26:27.668Z","releaseDate":"2015-09-01T11:26:27.668Z","project":"55e58b63d101191900f30b13"},"category":{"sync":{"isSync":false,"url":""},"pages":["55e58d21f11ba80d003238be","55e59fddd101191900f30b82","55e5a218f11ba80d00323911","55e5a28bf11ba80d00323915","55e5a2adf11ba80d00323917","55e5a335a603d62300f8926f","55e5a4cad101191900f30b9d","55e5a5396015ce1900eadb54","55e81c700f5df10d004a9c10"],"title":"JavaScript API","slug":"js-api","order":1,"from_sync":false,"reference":false,"_id":"55e58d16f493c11700584314","project":"55e58b63d101191900f30b13","__v":9,"createdAt":"2015-09-01T11:33:42.203Z","version":"55e58b63d101191900f30b16"},"user":"5b0d54a93b30dc0003c86052","createdAt":"2018-07-17T05:33:37.468Z","githubsync":"","__v":0,"parentDoc":null}

Trigger Preference Modal Box


[block:api-header] { "type": "basic", "title": "Trigger Preference Modal Box to let subscribers manage their notification preferences" } [/block] This is used to explicitly trigger the Preference Modal Box to let subscribers manage their notification preferences. ##Parameters 1. **triggerPreferences:** Command to trigger the Preference Modal Box. 2. **settingsObject:**(Type: DictionaryStrings, Optional): Contents of 'Settings Object' Dictionary: i. **Modal Title text:**(Type: String, Default: ‘You are subscribed to notifications from <account_company_name>’) - This is the general descriptive heading for the preference modal box. ii. **Start Tracking Button text:** (Type: String, Default: ‘Start Usage Tracking’) - This button lets subscribers restart their usage tracking if previously stopped. iii. **Stop Tracking Button text:** (Type: String, Default: ‘Stop Usage Tracking’) - This button lets subscribers stop their usage tracking. iv. **Access Data Button text:**(Type: String, Default: ‘Access My Notifications Data’) - This button lets subscribers download all their data stored at VWO Engage's end from your account. v. **Delete Data Button text:**(Type: String, Default: ‘Unsubscribe and Delete All My Data’) - This button lets subscribers unsubscribe from Web Push Notifications on your website and delete all their data stored at VWO Engage's end. ##Functionality 1. **If User is not subscribed**: Does not show the Preference Modal Box. 2. **If User is subscribed**: Shows the Preference Modal Box with the default values. 3. **If User has blocked:** Does not show the Preference Modal Box. 4. **If User has unsubscribed**: Shows the preference modal box. However, user can't take any action on this modal. Example code: [block:code] { "codes": [ { "code": "window._pcq = window._pcq || [];\n_pcq.push(['triggerPreferences']); //Calls Preference Modal Box with the default text\n\n\nwindow._pcq = window._pcq || [];\n_pcq.push(['triggerPreferences', 'Modal Title', 'Start Button', 'Stop Button', 'Access Data Button', 'Delete Data Button']); //Calls Preference Modal Box with the given custom texts", "language": "javascript" } ] } [/block] **Please Note: The order of the text parameters is important.**