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.
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.
If your implementation uses DTM, you can follow these steps:
- Log in to dtm.adobe.com and click the desired web property.
- Click the icon next to the Analytics tool.
- Under global variables, find an unused prop and set it to %window.location.host%%window.location.pathname%
- Save and deploy changes.
- Open your s_code.js file.
- Within the
doPlugins()function, add a line containing this code, replacing XX with the desired prop:
- Save the file and upload to your site.
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:
- Log in to Adobe Analytics and go to Admin > Report Suites.
- Select the correct report suite, and go to Edit Settings > General > Processing Rules.
- Click Add Rule, and create the following rule (Always Execute):
Overwrite value of [desired prop] with page_url
- Click Save.
Related Help Articles:
New to Adobe Analytics? Check out these related features: