C# Класс GoogleAnalyticsUtils.AnalyticsReporter

Client for the the Google Analytics Measurement Protocol service, which makes HTTP requests to publish data to a Google Analytics account

Наследование: IAnalyticsReporter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AnalyticsReporter ( string propertyId, string appName, string clientId = null, string appVersion = null, bool debug = false, string userAgent = null, IHitSender sender = null ) : System

Initializes the instance.

ReportEndSession ( ) : void

Reports that the session is ending.

ReportEvent ( string category, string action, string label = null, int value = null ) : void

Convenience method to report a single event to Google Analytics.

ReportPageView ( string page, string title, string host, string>.Dictionary customDimensions = null ) : void

Reports a page view hit to analytics.

ReportScreen ( string name ) : void

Reports a window view.

ReportStartSession ( ) : void

Reports that the session is starting.

Приватные методы

Метод Описание
GetCustomDimension ( int index ) : string
MakeBaseHitData ( ) : string>.Dictionary

Constructs the dictionary with the common parameters that all requests must have.

Описание методов

AnalyticsReporter() публичный Метод

Initializes the instance.
public AnalyticsReporter ( string propertyId, string appName, string clientId = null, string appVersion = null, bool debug = false, string userAgent = null, IHitSender sender = null ) : System
propertyId string The property ID to use, string with the format US-XXXX. Must not be null.
appName string The name of the app for which this reporter is reporting. Must not be null.
clientId string The client id to use when reporting, if null a new random Guid will be generated.
appVersion string Optional, the app version. Defaults to null.
debug bool Optional, whether this reporter is in debug mode. Defaults to false.
userAgent string Optiona, the user agent to use for all HTTP requests.
sender IHitSender The instance of to use to send the this.
Результат System

ReportEndSession() публичный Метод

Reports that the session is ending.
public ReportEndSession ( ) : void
Результат void

ReportEvent() публичный Метод

Convenience method to report a single event to Google Analytics.
public ReportEvent ( string category, string action, string label = null, int value = null ) : void
category string The category for the event.
action string The action that took place.
label string The label affected by the event.
value int The new value.
Результат void

ReportPageView() публичный Метод

Reports a page view hit to analytics.
public ReportPageView ( string page, string title, string host, string>.Dictionary customDimensions = null ) : void
page string The URL to the page.
title string The page title.
host string The page host name.
customDimensions string>.Dictionary Custom dimensions to add to the hit.
Результат void

ReportScreen() публичный Метод

Reports a window view.
public ReportScreen ( string name ) : void
name string The name of the window. Must not be null.
Результат void

ReportStartSession() публичный Метод

Reports that the session is starting.
public ReportStartSession ( ) : void
Результат void