FintezaAnalytics.AspNetCore 1.0.2

dotnet add package FintezaAnalytics.AspNetCore --version 1.0.2                
NuGet\Install-Package FintezaAnalytics.AspNetCore -Version 1.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FintezaAnalytics.AspNetCore" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FintezaAnalytics.AspNetCore --version 1.0.2                
#r "nuget: FintezaAnalytics.AspNetCore, 1.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FintezaAnalytics.AspNetCore as a Cake Addin
#addin nuget:?package=FintezaAnalytics.AspNetCore&version=1.0.2

// Install FintezaAnalytics.AspNetCore as a Cake Tool
#tool nuget:?package=FintezaAnalytics.AspNetCore&version=1.0.2                

Using

using FintezaAnalytics;
...
// call the SDK methods

Initialization

To initialize the SDK, call the AddFintezaAnalytics method inside the ConfigureServices method of the Startup class:

services.AddFintezaAnalytics(options =>
{
    options.WebsiteId = "{WEBSITE_ID}";
});

Specify the following parameters:

  • WebsiteId * - Website ID. It can be obtained in the website settings (ID field) of the Finteza panel.
  • Url - Finteza server address. In most cases, it should not be changed.

Proxying requests

To enable proxying, set its parameters in addition to the main parameters in the AddFintezaAnalytics initialization method:

services.AddFintezaAnalytics(options =>
{
    options.WebsiteId = "{WEBSITE_ID}";
    options.Token = "{Token}";
    options.Path = "{Path}";
});
  • Token * - Token for signing the X-Forwarded-For header. You can get this value in the website settings of the Finteza panel: open the Counter section, enable the "Proxying the script and requests" option and copy the value from the "Proxy token" field.
  • Path - Beginning of the path for requests to be proxied. If the parameter is not specified, the default /fz value will be used.

After that, add the following line in the Configure method of the Startup class:

app.UseFintezaAnalyticsProxy();

Sending events

Call the ITracker.SendEvent method. For this purpose, obtain the ITracker implementation using Dependency Injection. For example, this can be done using the following injection into the constructor:

class SomeClass
{
    public SomeClass(ITracker tracker)
    {
        tracker.SendEvent(name: "{EVENT}", referer: "{REFERER}");
    }
}

Using this method, you can register the events and pass additional information as parameters, for example, a type of a purchased good, price, currency, etc. The following parameters are supported:

  • name * - Event name. The maximum length is 128 symbols.
  • referer - The host on which the SDK runs.
  • backReferer - The address of a web page a visitor was located at before performing a tracked action.
  • userIp - The IP address of the visitor who performed a tracked action.
  • userAgent - The user-agent of the visitor who performed a tracked action.
  • unit - Parameter measurement units, for example, USD, items, etc. The maximum length is 32 characters.
  • value - The value of the parameter. The maximum length is 64 symbols.

There is no need to specify the referer parameter each time the event is sent, if you set its default value during initialization. During AddFintezaAnalytics call, specify the additional parameter DefaultReferer:

services.AddFintezaAnalytics(options =>
{
    options.WebsiteId = "{WEBSITE_ID}";
    options.DefaultReferer = "{DEFAULT_REFERER}";
});

If you do not use DefaultReferer, specify referer during each SendEvent call. Otherwise, the events will not be sent.

Another variant is available for the ITracker.SendEvent function:

tracker.SendEvent({CONTEXT}, "{EVENT}");

Instead of the explicit specification of referer, backReferer, userIp, userAgent, here the request execution context is specified, from which the specified parameters will be received and sent to Finteza.

  • httpContext * - Current HTTP request execution context, from which parameters referer, backReferer, userIp and userAgent are automatically formed.
  • name * - Event name. The maximum length is 128 symbols.
  • unit - Parameter measurement units, for example, USD, items, etc. The maximum length is 32 characters.
  • value - The value of the parameter. The maximum length is 64 symbols.


* - required parameters

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 1,398 2/13/2020
1.0.1 452 1/23/2020
1.0.0 454 1/21/2020