On this page:
For example, customers on your home page of your website can either register an account or log in. The Ajax request may pass the parameter
action to reflect one of these user actions. By capturing the
action parameter, you can differentiate the Ajax requests to monitor performance and debug issues.
You use the
xhr object has the property
parameter that is used to match resource URLs and define a callback for parsing the request body and return the desired results.
In the example below, the configuration sets a pattern to match the URL
, parses the request body, and returns an object containing the parameter
action. As mentioned earlier, you could use a configuration like this to differentiate Ajax requests that are sending requests to register or log in users.
Create an Ajax Include Rule
To name an Ajax request based on a captured request parameter, you need to define an include rule that specifies the captured POST parameter. See Configure Page Naming for Ajax Requests to learn how to create include rules for Ajax requests.
The example include rule below uses the full domain and the captured POST parameter to name the Ajax request in the Pages & Ajax Requests page. For example, if an Ajax request is made to
www.mystore.com and the value of the
action parameter is
register, the Ajax request will be named www.mystore.com/register.
View Results in Pages & Ajax Requests
From the Pages & Ajax Requests page, you can view the Ajax requests that are named based on your include rule.
Using the configuration and include rule shown above, you might see the following Ajax request with the name mystore.com/register.