SPAs and Attribution
07 Dec 2025 » Analytics Tips
I wanted to share an issue one of my customers recently encountered. They called me saying that they had found issues in Adobe Analytics attribution and they were questioning the quality of the data. After digging into it, we found that the problem was due to their Single Page Application (SPA) implementation. If your website uses any SPA technology, this post interests you.
Page Views
In traditional websites (i.e., those that do not use any SPA technology), every page view is a full page download. After clicking on internal links, the browser unloads the previous page, releasing all the resources, and loads the new page. From a technical perspective, it is very clear what a page view is, and you can easily configure Web SDK to send data with every new page view.
However, with SPAs, only the first page is a full download. All subsequent clicks trigger the download of only the content specific to the new page. The rest of the page stays the same: menu, header, side bars, footer… In other words, while the end users feel like they are moving from page to page, technically, the browser does not unload any pages nor release any resources, and thinks it is always on the first page. Page view events are sent to Adobe Analytics or Adobe Experience Platform Edge based on arbitrary rules included in the SPA controller, typically when more than 50% of the content of the page changes.
This behavior has a direct impact on the page metadata, in particular, the previous URL or referrer, which is accessible through document.referrer. Web SDK uses this parameter for the previous page URL.
In the case of traditional websites, this parameter is automatically updated with every page refresh, and, as expected, it holds the URL to the previous page. However, in SPAs, since the browser only fully loads the first page, the referrer does not get updated again with every click.
The Attribution Problem in SPAs
Let’s consider a scenario with the following Adobe Analytics Marketing Channels rules:
| Order | Channel | Rules |
|---|---|---|
| 1 | Paid Search | Referrer is search engine AND campaign ID is present |
| 2 | Natural Search | Referrer is search engine |
| 3 | Paid Social | Referrer is social site AND campaign ID is present |
| 4 | Natural Social | Referrer is social site |
Next, consider the following chain of events from an end user perspective, where the website is an SPA:
| # | Event | Referrer | Campaign ID | Marketing Channel |
|---|---|---|---|---|
| 1 | Searches in Google | |||
| 2 | Clicks on paid link and lands on website | https://www.google.com/ | a1b2c3d4e5 | Paid Search |
| 3 | Clicks on an internal link | https://www.google.com/ | Natural Search | |
| 4 | Clicks on another internal link | https://www.google.com/ | Natural Search |
As you can see, on the landing page, the marketing channel was correctly identified, but it then gets updated to a wrong value from the second page onwards. Any conversion further down the line would then be attributed to “Natural Search”, when it should have been attributed to “Paid Search”.
If you think that Adobe Analytics has enough information to know that it is an internal link, think again. Consider this alternative series of events:
| # | Event | Referrer | Campaign ID | Marketing Channel |
|---|---|---|---|---|
| 1 | Searches in Google | |||
| 2 | Clicks on paid link and lands on website | https://www.google.com/ | a1b2c3d4e5 | Paid Search |
| 3 | Clicks on back button and lands on Google again | |||
| 4 | Clicks on organic link and lands on website | https://www.google.com/ | Natural Search | |
| 5 | Clicks on an internal link | https://www.google.com/ | Natural Search | |
| 6 | Clicks on another internal link | https://www.google.com/ | Natural Search |
With this new scenario, although events 5 and 6 should not carry any marketing channel value, the value they get is actually correct, and attribution would be fine. However, the crucial question is: how can Adobe Analytics know the difference between this example and the one before? It cannot. They both look exactly the same, as Google does not send any data to Adobe Analytics.
This problem does not exist on a traditional website. The clicks on internal links will carry the correct URL in the referrer. They will be correctly identified as internal URLs and will not generate new Marketing Channel values. I want to also clarify that this explanation refers to last-touch attribution; first-touch attribution should always be correct.
The Solution
Ideally, you would want to tweak the Marketing Channels rules to deal with this scenario. Unfortunately, this is not always possible. Marketing Channels rules only evaluate the current hit, with no context of previous hits. Crucial information needed to correctly identify the marketing channel is present in these previous hits. For example, in event 3 of the second table above, the Marketing Channels engine only sees that the referrer is Google.
The best solution is to modify your Web SDK implementation, either manually or through Adobe Tags. Your rules should keep track of the previous page that was shown and use it to populate web > webReferrer > URL (see the Web Details field group) with the correct, internal URL. If you use Adobe Tags, you will probably need a Data Element.
For more information, read this Experience League post: Web SDK Part 4: Avoiding Banana Peels (Banana Peel #6).
Photo by Alex Bertha on Unsplash