Page URL can be a powerful variable in determining various insights on a page where Page Name is not accurate or descriptive enough. It is available by default in Data Feeds and Data Warehouse, but currently not available as a dimension within Adobe Analytics reporting. However, minor implementation modifications can be made to obtain it. As with almost all implementation modifications, these recommendations only apply to data moving forward, not retroactively.


Altering your implementation can cause data loss if configured improperly (such as overwriting existing variable values). If you would like assistance in making implementation changes, contact your Account Manager who can arrange a consulting engagement.

Code to populate page URL

Depending on what is desired, any of the following can be used:

// Using JavaScript
[, location.pathname].join('');
// Using DTM

Adobe strongly recommends using this method. It drastically reduces the number of unique URLs, as it does not include protocol or query strings. Content delivered via HTTP and HTTPS are considered to be the same line item.


The D=g method uses dynamic variables. The query string 'g' captures the page URL in an image request.  Data collection servers interpet 'D=' to copy that value and assign it to the variable you specify. While an image request value states 'D-g', the actual value recorded is the full URL.

Using dynamic variable assignments include the query string and protocol. Similar URLs delivered through HTTP and HTTPS are considered separate values, as are identical URLs with different query strings. Using the full URL can easily lead to low-traffic values and exceed the byte limit for custom variables.


Using window.location.href is not recommended, as it is the same as the dynamic variable method but makes the image request character length much longer. 

Method 1: Implementation via DTM

If your implementation uses DTM, you can follow these steps:

  1. Log in to and click the desired web property.
  2. Click the icon next to the Analytics tool.
  3. Under global variables, find an unused prop and set it to
  4. Save and deploy changes.

Method 2: Implementation using s_code

If your organization is not using DTM, you can assign the variable value within your core JavaScript file:

  1. Open your s_code.js file.
  2. Within the doPlugins() function, add a line containing this code, replacing XX with the desired prop:
    s.propXX=[, location.pathname].join('');
  3. Save the file and upload to your site.

Method 3: Using processing rules

If you are authorized to use processing rules, you can use them to automatically populate a variable with page URL. However, this method does not allow stripped query strings or protocol:

  1. Log in to Adobe Analytics and go to Admin > Report Suites.
  2. Select the correct report suite, and go to Edit Settings > General > Processing Rules.
  3. Click Add Rule, and create the following rule (Always Execute):
    Overwrite value of [desired prop] with page_url
  4. Click Save.

Additional resources