Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ public class MeasurementConfiguration
/// </summary>
public bool UseSsl { get; set; }

/// <summary>
/// Gets or sets a value indicating whether to use the debug URL.
/// </summary>
/// <value>
/// <c>true</c> if to use the debug URL; otherwise, <c>false</c>.
/// </value>
public bool UseDebugUrl { get; set; }

/// <summary>
/// Sample rate percentage to determine how likely new visitors will be tracked.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal class MeasurementUriBuilder
private static readonly Random random = new Random();
private static readonly Uri trackingEndpoint = new Uri("http://www.google-analytics.com/collect");
private static readonly Uri secureTrackingEndpoint = new Uri("https://ssl.google-analytics.com/collect");
private static readonly Uri debugTrackingEndpoint = new Uri("https://www.google-analytics.com/debug/collect");

private readonly SessionManager sessionManager;
private readonly MeasurementConfiguration configuration;
Expand Down Expand Up @@ -52,7 +53,11 @@ public Uri BuildUri(MeasurementActivity activity)
{
var parameters = BuildParameterList(activity);
CarryForwardParameters(activity, parameters);
var endpoint = configuration.UseSsl ? secureTrackingEndpoint : trackingEndpoint;
var endpoint = configuration.UseDebugUrl
? debugTrackingEndpoint
: configuration.UseSsl
? secureTrackingEndpoint
: trackingEndpoint;

// Fragment is only added temporarily and used to calculate queue time.
// It will be removed in MeasurementAnalyticsClient.AdjustUriBeforeRequest.
Expand Down