Expand my Community achievements bar.

Webinar: Adobe Customer Journey Analytics Product Innovations: A Quarterly Overview. Come learn for the Adobe Analytics Product team who will be covering AJO reporting, Graph-based Stitching, guided analysis for CJA, and more!
SOLVED

What's the replacement of s.referrer in WebSDk

Avatar

Level 1

We have moved our pages to AEP WebSDK on some pages and for us to implement below, we would need to know where in XDM would the Referrer be? 

https://experienceleague.adobe.com/docs/analytics/technotes/redirects.html?lang=en 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Use the "web.webReferrer.URL" field in your XDM object.

Reference: list of automatically mapped variables: https://experienceleague.adobe.com/docs/analytics/implementation/aep-edge/variable-mapping.html?lang...

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Use the "web.webReferrer.URL" field in your XDM object.

Reference: list of automatically mapped variables: https://experienceleague.adobe.com/docs/analytics/implementation/aep-edge/variable-mapping.html?lang...

Avatar

Level 3

Hi @yuhuisg 

 

When we use tjhe above field, do we need to map a value from the datalayer to the field or does webSDK have the capability of implementing doPlugins through which we can get the value of the Referring url and then map it to the xdm field?

 

If yes, how do we implement that?

Thanks

Avatar

Community Advisor

If you're using Web SDK, then there is no doPlugins to speak of. doPlugins is only use with AA's AppMeasurement tracking library.

The value for that field can come from any data element that you want. The process is similar to how you would populate any other field in your Web SDK XDM schema.

By default, Web SDK will populate the field from the user's browser's document.referrer object for the viewed web page. However, note that given today's state of data security and privacy, data.referrer might sometimes not have a value. (The reason why this happens is beyond the scope of this question.)

Avatar

Community Advisor

To implement a solution similar to the one described in the "Redirects & Tracking Codes" article using Adobe Experience Platform (AEP) Web SDK, you'll need to send the referrer information as part of the XDM schema in your track events.

Here's how you can achieve this:

First, create a custom XDM field to store the referrer information. In the Adobe Experience Platform, navigate to your XDM schema and add a new field (e.g., webReferrer) under the appropriate data type (such as WebPageDetails).

In your website's code, extract the referrer information from the URL. You can use JavaScript to get the referrer URL:

 

const referrerUrl = document.referrer;

In your track event call, include the referrer information within the XDM schema. For example:


alloy("sendEvent", {
"xdm": {
"web": {
"webPageDetails": {
"webReferrer": referrerUrl
}
}
}
});

Now that you're sending the referrer information as part of your XDM schema, you can set up processing rules in Adobe Analytics to capture this data in a prop or eVar.

By following these steps, you can track referrer information using AEP Web SDK and include it in your Adobe Analytics reports.