Skip to main content

Methods of Adding Data to Parameters

Four ways to populate parameter values in Trackdesk scripts: query parameters, cookies, fixed values, and custom code.

Trackdesk scripts can fill in parameter values, such as an External ID, by reading them from the page URL or a cookie. You can also use a fixed value, or insert the value yourself or with custom code.

Using query parameters

When the query parameter method is used, our script takes the parameter value from the specified variable in the URL.

In the example below, the value in a query parameter myQueryParamName is saved to our External ID parameter.

externalId: { queryParam: "myQueryParamName" },


​

Using cookie parameters

When the cookie parameter method is used, our script takes the parameter value from the specified cookie.

In the example below, the value present in a cookie myCookieName is saved to our External ID parameter.

externalId: { cookieParam: "myCookieName" },


​

Using a fixed value

You can use fixed values for parameters that don't change.

externalId: "12345",


​

Editing manually or by custom functionality

You can replace a value by yourself before running the script. Keep in mind that the value needs to be a valid string for all the parameters.

Third parties often use a specific placeholder for the value parameter. You can usually find this information in their knowledge base or help center, or by asking their support team directly.

Alternatively, a developer can implement a custom function to dynamically insert the value as needed.


​

See also

Did this answer your question?