URL referrer in App Insights

Zarqa Javed (eXcell) 1 Reputation point
2021-02-02T03:16:16.887+00:00

We are monitoring our website metrics using App Insights. Is there any way to track URL referrers to this tool? Or plans to add that capability?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,313 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 18,771 Reputation points
    2021-02-08T03:38:35.247+00:00

    @Zarqa Javed (eXcell) Welcome to Microsoft Q & A Community Forum. In order to log the URL referrers, you can create Telemetry Initializer to add URL referrer to the request. Sample code for your reference.

    public void Initialize(ITelemetry telemetry)  
    {  
    	var requestTelemetry = telemetry as RequestTelemetry;  
    	  
    	if (requestTelemetry != null)  
    	{  
    		string referrer = HttpContext.Current.Request.UrlReferrer.ToString();  
    		telemetry.Context.Properties.Add("Referrer", referrer);  
    	}  
    }  
    

    Here are few reference articles that might help you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.