Edit in GitHubLog an issue

targetPageParamsAll()

This method allows you to attach parameters to all mboxes from outside of the request code.

This is very useful for including the same set of parameters on multiple mbox calls. The function needs to be defined by the customer. It should return an array of parameters that will be passed to all mbox requests on the page. This function can be defined before at.js is loaded or in Administration > Implementation > Edit > Code Settings > Library Header.

You can pass in parameters to target-global-mbox using the targetPageParamsAll() function in any of the following ways:

  • An ampersand-delimited list
  • An array
  • A JSON object

Examples#

Ampersand-delimited list (values must be URL encoded):

Copied to your clipboard
1function targetPageParamsAll() {
2 return "param1=value1&param2=value2&p3=hello%20world";
3}

Array (values do not need to be URL encoded):

Copied to your clipboard
1targetPageParamsAll = function() {
2 return ["a=1", "b=2", "c=hello world"];
3};

JSON (values do not need to be URL encoded):

Copied to your clipboard
1targetPageParamsAll = function() {
2 return {
3 "a": 1,
4 "b": 2,
5 "profile": {
6 "age": 26,
7 "country": {
8 "city": "San Francisco"
9 }
10 }
11 };
12};
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.