appsflyer_sdk

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 9 Imported by: 0

README

Appsflyer SDK GO

Build Status codecov License

Description

Appsflyer API Client for Go (reporting)

API documentation

https://support.appsflyer.com/hc/en-us/articles/209680773-Raw-data-reporting-overview

Download

go get github.com/kachit/appsflyer-sdk-go

Usage

package main

import (
	"fmt"
	appsflyer_sdk "github.com/kachit/appsflyer-sdk-go"
	"time"
)

func main() {
	location, _ := time.LoadLocation("Europe/Moscow")
	
	from := time.Date(2020, time.Month(9), 10, 0, 0, 0, 0, location)
	to := time.Date(2020, time.Month(9), 11, 0, 0, 0, 0, location)
	
	config := appsflyer_sdk.NewConfig("foo", "bar")
	client := appsflyer_sdk.NewClient(config, nil)
	
	filter := &appsflyer_sdk.InstallsReportFilter{
		StartDate: from,
		EndDate: to,
	}
	response, err := client.Reports().GetInstallReports(filter)
    if err != nil {
        fmt.Println(response.GetData())
    }
	
	fmt.Println(err)
}

Documentation

Index

Constants

View Source
const (
	ApiBaseUrl = "https://hq.appsflyer.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppsEventReportFilter

type AppsEventReportFilter struct {
	StartDate        time.Time
	EndDate          time.Time
	UseTimezone      bool
	AdditionalFields []string
}

func (*AppsEventReportFilter) Build

func (f *AppsEventReportFilter) Build() map[string]interface{}

func (*AppsEventReportFilter) IsValid

func (f *AppsEventReportFilter) IsValid() error

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config, cl *http.Client) *Client

func (*Client) Reports

func (c *Client) Reports() *ReportsResource

type Config

type Config struct {
	Uri      string
	APIToken string
	AppId    string
}

func NewConfig

func NewConfig(apiToken string, appId string) *Config

type CustomDate added in v0.0.2

type CustomDate struct {
	Date time.Time
}

func (*CustomDate) UnmarshalJSON added in v0.0.2

func (ct *CustomDate) UnmarshalJSON(data []byte) error

func (*CustomDate) Value added in v0.0.2

func (ct *CustomDate) Value() time.Time

type CustomFloat64 added in v0.0.2

type CustomFloat64 struct {
	Float64 float64
}

func (*CustomFloat64) UnmarshalJSON added in v0.0.2

func (cf *CustomFloat64) UnmarshalJSON(data []byte) error

func (*CustomFloat64) Value added in v0.0.2

func (cf *CustomFloat64) Value() float64

type CustomTimestamp added in v0.0.2

type CustomTimestamp struct {
	Timestamp time.Time
}

func (*CustomTimestamp) UnmarshalCSV added in v0.0.2

func (ct *CustomTimestamp) UnmarshalCSV(csv string) (err error)

func (*CustomTimestamp) UnmarshalJSON added in v0.0.2

func (ct *CustomTimestamp) UnmarshalJSON(data []byte) error

func (*CustomTimestamp) Value added in v0.0.2

func (ct *CustomTimestamp) Value() time.Time

type InstallsReportFilter

type InstallsReportFilter struct {
	StartDate        time.Time
	EndDate          time.Time
	UseTimezone      bool
	AdditionalFields []string
}

func (*InstallsReportFilter) Build

func (f *InstallsReportFilter) Build() map[string]interface{}

func (*InstallsReportFilter) IsValid

func (f *InstallsReportFilter) IsValid() error

type Report

type Report struct {
	AttributedTouchType  string          `json:"attributed_touch_type" csv:"Attributed Touch Type"`
	AttributedTouchTime  CustomTimestamp `json:"attributed_touch_time" csv:"Attributed Touch Time"`
	InstallTime          CustomTimestamp `json:"install_time" csv:"Install Time"`
	EventTime            CustomTimestamp `json:"event_time" csv:"Event Time"`
	EventName            string          `json:"event_name" csv:"Event Name"`
	EventValue           string          `json:"event_value" csv:"Event Value"`
	EventRevenue         string          `json:"event_revenue" csv:"Event Revenue"`
	EventRevenueCurrency string          `json:"event_revenue_currency" csv:"Event Revenue Currency"`
	EventRevenueUSD      string          `json:"event_revenue_usd" csv:"Event Revenue USD"`
	EventSource          string          `json:"event_source" csv:"Event Source"`
	IsReceiptValidated   string          `json:"is_receipt_validated" csv:"Is Receipt Validated"`
	Partner              string          `json:"partner" csv:"Partner"`
	MediaSource          string          `json:"media_source" csv:"Media Source"`
	Channel              string          `json:"channel" csv:"Channel"`
	Keywords             string          `json:"keywords" csv:"Keywords"`
	Campaign             string          `json:"campaign" csv:"Campaign"`
	AdSet                string          `json:"adset" csv:"Adset"`
	AdsetID              string          `json:"adset_id" csv:"Adset ID"`
	Ad                   string          `json:"ad" csv:"Ad"`
	AdType               string          `json:"ad_type" csv:"Ad Type"`
	Region               string          `json:"region" csv:"Region"`
	CountryCode          string          `json:"country_code" csv:"Country Code"`
	State                string          `json:"state" csv:"State"`
	City                 string          `json:"city" csv:"City"`
	PostalCode           string          `json:"postal_code" csv:"Postal Code"`
	DMA                  string          `json:"dma" csv:"DMA"`
	IP                   string          `json:"ip" csv:"IP"`
	WIFI                 string          `json:"wifi" csv:"WIFI"`
	Language             string          `json:"language" csv:"Language"`
	AppsflyerID          string          `json:"appsflyer_id" csv:"AppsFlyer ID"`
	AdvertisingID        string          `json:"advertising_id" csv:"Advertising ID"`
	IDFA                 string          `json:"idfa" csv:"IDFA"`
	IDFV                 string          `json:"idfv" csv:"IDFV"`
	Platform             string          `json:"platform" csv:"Platform"`
	DeviceType           string          `json:"device_type" csv:"Device Type"`
	OSVersion            string          `json:"os_version" csv:"OS Version"`
	AppVersion           string          `json:"app_version" csv:"App Version"`
	SDKVersion           string          `json:"sdk_version" csv:"SDK Version"`
	AppID                string          `json:"app_id" csv:"App ID"`
	AppName              string          `json:"app_name" csv:"App Name"`
	BundleID             string          `json:"bundle_id" csv:"Bundle ID"`
	IsRetargeting        string          `json:"is_retargeting" csv:"Is Retargeting"`
	CustomerUserID       string          `json:"customer_user_id" csv:"Customer User ID"`

	AndroidID      string `json:"android_id" csv:"Android ID"`
	UserAgent      string `json:"user_agent" csv:"User Agent"`
	HTTPReferrer   string `json:"http_referrer" csv:"HTTP Referrer"`
	OriginalURL    string `json:"original_url" csv:"Original URL"`
	KeywordID      string `json:"keyword_id" csv:"Keyword ID"`
	StoreReinstall string `json:"store_reinstall" csv:"Store Reinstall"`
	DeeplinkURL    string `json:"deeplink_url" csv:"Deeplink URL"`

	OAID            string `json:"oaid" csv:"OAID"`
	InstallAppStore string `json:"install_app_store" csv:"Install App Store"`
	MatchType       string `json:"match_type" csv:"Match Type"`
	DeviceCategory  string `json:"device_category" csv:"Device Category"`
}

func (*Report) GetIsRetargeting

func (r *Report) GetIsRetargeting() bool

type ReportsCollection added in v0.0.2

type ReportsCollection struct {
	Reports []*Report
}

type ReportsResource

type ReportsResource struct {
	*ResourceAbstract
}

func (*ReportsResource) GetInstallReports

func (rr *ReportsResource) GetInstallReports(filter *InstallsReportFilter) (*Response, error)

type RequestBuilder

type RequestBuilder struct {
	// contains filtered or unexported fields
}

type ResourceAbstract

type ResourceAbstract struct {
	// contains filtered or unexported fields
}

type Response

type Response struct {
	// contains filtered or unexported fields
}

func (*Response) GetData

func (r *Response) GetData() ([]*Report, error)

func (*Response) GetRaw

func (r *Response) GetRaw() *http.Response

func (*Response) IsSuccess

func (r *Response) IsSuccess() bool

func (*Response) UnmarshalCSV added in v0.0.2

func (r *Response) UnmarshalCSV(reports []*Report) error

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL