Edit in GitHubLog an issue

targetPageParams()

This method allows you to attach parameters to the global mbox from outside of the request code.

This function 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 only to the global mbox request. This function can be defined before at.js is loaded or in Administration > Implementation > Edit > Library Header.

You can pass in parameters to target-global-mbox using the targetPageParams() 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 targetPageParams() {
2 return "param1=value1&param2=value2&p3=hello%20world";
3}

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

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

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

Copied to your clipboard
1targetPageParams = 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.