ITBees.AdConversions 8.0.13

dotnet add package ITBees.AdConversions --version 8.0.13
                    
NuGet\Install-Package ITBees.AdConversions -Version 8.0.13
                    
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="ITBees.AdConversions" Version="8.0.13" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ITBees.AdConversions" Version="8.0.13" />
                    
Directory.Packages.props
<PackageReference Include="ITBees.AdConversions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ITBees.AdConversions --version 8.0.13
                    
#r "nuget: ITBees.AdConversions, 8.0.13"
                    
#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.
#:package ITBees.AdConversions@8.0.13
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ITBees.AdConversions&version=8.0.13
                    
Install as a Cake Addin
#tool nuget:?package=ITBees.AdConversions&version=8.0.13
                    
Install as a Cake Tool

ITBees.AdConversions

Konwersje reklamowe dla aplikacji FAS: opłacony zakup zgłaszany platformom reklamowym (Meta - API konwersji, Google Ads - Data Manager API) razem z jego pochodzeniem. Dane dostępowe platform operator wpisuje w panelu administracyjnym (fas-admin, widok Reklamy) - są w bazie aplikacji, nie w konfiguracji.

Biblioteka daje:

  • platformy IAdConversionPlatform (Meta, Google Ads) z opisem pól ustawień - panel rysuje z niego formularze,
  • ustawienia platform w bazie (AdPlatformSettings), tokeny nigdy nie wracają do przeglądarki,
  • wysyłkę z ponawianiem i historią (AdConversion, AdConversionDelivery), worker budzony po żądaniach, które zamykają płatność,
  • kontrolery dla panelu (rola PlatformOperator): GET/PUT /AdPlatformSettings, POST /AdPlatformConnectionTest, GET /AdConversions.

Aplikacja hosta pisze sama tylko to, czego biblioteka nie może wiedzieć: co jest zakupem i skąd przyszedł klient. Przykład: Api/Services/AdConversions w repozytorium Kilometrówki (opis: docs/ad-conversions.md tamże).

Podpięcie w aplikacji

  1. Paczka NuGet ITBees.AdConversions (buduje się z gałęzi master tego repozytorium):

    <PackageReference Include="ITBees.AdConversions" Version="8.0.*" />
    
  2. Encje w DbContext i migracja:

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        ITBees.AdConversions.Setup.DbModelBuilder.Register(modelBuilder);
        // ...
    }
    
  3. Rejestracja (aplikacja musi udostępniać generyczne repozytoria ITBees i IHttpClientFactory):

    new AdConversionsSetup().Register(builder.Services, new AdConversionsOptions
    {
        Enabled = true,
        // Adresy własnych żądań hosta, które zamykają płatność (domyślnie są tu endpointy biblioteki płatności FAS).
        PaymentPathFragments = { "PaymentConfirmation" }
    });
    builder.Services.AddScoped<IAdConversionSource, MyPurchasesSource>();
    builder.Services.AddScoped<IAdConversionCustomerProvider, MyCustomerProvider>();   // opcjonalnie
    

    i w Program.cs, przed MapControllers:

    app.UseAdConversionSignals();
    
  4. Źródło zakupów - IAdConversionSource.RecordNewPurchases(): znajduje opłacone płatności bez wiersza AdConversion i zapisuje je (IWriteOnlyRepository<AdConversion>). Unikalne Kind + SourceGuid pilnuje, żeby zakup zapisał się raz. Do wypełnienia:

    Pole Co
    Kind, SourceGuid rodzaj zakupu hosta i identyfikator płatności / zamówienia
    TransactionId identyfikator, który zgłasza też tag w przeglądarce (platforma liczy zakup raz)
    PaidAt, Value, Currency, Description chwila płatności (czas serwera), wartość zgłaszana platformom
    UserAccountGuid, CompanyGuid kto kupił
    MarketingConsent klient zgodził się na cookies marketingowe - bez tego nic nie idzie do platform
    GoogleClickId + GoogleClickKind (gclid / gbraid / wbraid) kliknięcie reklamy Google
    Fbc, Fbp ciasteczka piksela Meta (_fbc można złożyć z fbclid: fb.1.{ms}.{fbclid})
    ClientIpAddress, ClientUserAgent, EventSourceUrl dane przeglądarki i strona podziękowania (Meta)
    AttributedPlatform, ChannelName, SourceLabel, Utm*, LandingPage, Referrer komu host przypisał zakup - do panelu i do custom_data Meta

    Identyfikatory kliknięć front musi zapamiętać przy wejściu z reklamy i przekazać do API - w Kilometrówce robi to km-acquisition.js (kilometrowkaangular, src/assets/acquisition) razem z POST /AccountAcquisitionSource i POST /AdCheckoutTouch.

  5. Dane klienta - IAdConversionCustomerProvider.Get(conversion): e-mail, telefon, imię, nazwisko, miasto, kod pocztowy, identyfikator konta. Biblioteka haszuje je (SHA-256) przed wysyłką i woła providera tylko dla zakupów ze zgodą marketingową. Bez providera platformy dostają same identyfikatory kliknięć.

  6. Panel: w konfiguracji fas-admin hosta dodać 'ad-platforms' do accessRules roli PlatformOperator - pozycja „Reklamy” pojawi się w menu.

Nowa platforma

Klasa implementująca IAdConversionPlatform: Key, Name, Description, Fields (pola ustawień: tekst, token, przełącznik - z podpowiedziami i wartościami domyślnymi), MaxEventAge, SendAsync (decyduje, czy zakup jej dotyczy, i wysyła go) oraz TestAsync („Sprawdź połączenie”). Rejestracja: services.AddScoped<IAdConversionPlatform, MyPlatform>(). Ustawienia w panelu, kolejka, ponawianie i historia działają bez dalszych zmian.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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
8.0.13 95 11/26/2026