types

package
v0.0.0-...-c0dfe14 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionSource

type ActionSource string
const (
	Email             ActionSource = "email"
	Website           ActionSource = "website"
	App               ActionSource = "app"
	PhoneCall         ActionSource = "phone_call"
	Chat              ActionSource = "chat"
	PhysicalStore     ActionSource = "physical_store"
	SystemGenerated   ActionSource = "system_generated"
	BusinessMessaging ActionSource = "business_messsaging"
	Other             ActionSource = "other"
)

type Content

type Content struct {
	ID               string `json:"id,omitempty"`
	Quantity         int    `json:"quantity,omitempty"`
	DeliveryCategory string `json:"delivery_category,omitempty"`
}

Contents entity is a part of standart parameters. A list of JSON objects that contain the product IDs associated with the event plus information about the products

type Contents

type Contents []Content

func NewContents

func NewContents() Contents

func (Contents) AddContent

func (c Contents) AddContent(content Content) Contents

type CustomerInformation

type CustomerInformation struct {
	Email           []string `json:"em,omitempty"`
	PhoneNumber     []string `json:"ph,omitempty"`
	FirstName       string   `json:"fn,omitempty"`
	LastName        string   `json:"ln,omitempty"`
	City            string   `json:"ct,omitempty"`
	State           string   `json:"st,omitempty"`
	Zip             string   `json:"zp,omitempty"`
	Country         string   `json:"country,omitempty"`
	ClientIPAddress string   `json:"client_ip_address,omitempty"`
	ClientUserAgent string   `json:"client_user_agent,omitempty"`
	Fbc             string   `json:"fbc,omitempty"`
	Fbp             string   `json:"fbp,omitempty"`
}

CutomerInfromation entity https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters

func NewCustomerInformation

func NewCustomerInformation() CustomerInformation

func (CustomerInformation) WithCity

func (CustomerInformation) WithClientIPAddress

func (ci CustomerInformation) WithClientIPAddress(clientIPAddress string) CustomerInformation

func (CustomerInformation) WithClientUserAgent

func (ci CustomerInformation) WithClientUserAgent(clientUserAgent string) CustomerInformation

func (CustomerInformation) WithCountry

func (ci CustomerInformation) WithCountry(country string) CustomerInformation

func (CustomerInformation) WithEmail

func (ci CustomerInformation) WithEmail(email string) CustomerInformation

Adds non-hashed email to the struct for it to be hashed.

func (CustomerInformation) WithFbc

func (CustomerInformation) WithFbp

func (CustomerInformation) WithFirstName

func (ci CustomerInformation) WithFirstName(first string) CustomerInformation

func (CustomerInformation) WithHashedEmail

func (ci CustomerInformation) WithHashedEmail(hashedEmail string) CustomerInformation

Adds already hashed email to the struct

func (CustomerInformation) WithHashedPhoneNumber

func (ci CustomerInformation) WithHashedPhoneNumber(hashedPhoneNumber string) CustomerInformation

Adds already hashed email to the struct

func (CustomerInformation) WithLastName

func (ci CustomerInformation) WithLastName(last string) CustomerInformation

func (CustomerInformation) WithPhoneNumber

func (ci CustomerInformation) WithPhoneNumber(email string) CustomerInformation

Adds non-hashed phoneNumber to the struct for it to be hashed.

func (CustomerInformation) WithState

func (ci CustomerInformation) WithState(state string) CustomerInformation

func (CustomerInformation) WithZip

type ServerEvent

type ServerEvent struct {
	EventName      string              `json:"event_name"`
	EventID        string              `json:"event_id"`
	EventTime      UnixTime            `json:"event_time"`
	EventSourceURL string              `json:"event_source_url"`
	ActionSource   ActionSource        `json:"action_source"`
	UserData       CustomerInformation `json:"user_data,omitempty"`
	Contents       Contents            `json:"contents,omitempty"`

	// CustomData might represent your cutom struct with any fields.
	CustomData interface{} `json:"custom_data,omitempty"`
}

ServerEvent entity https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/server-event

func NewServerEvent

func NewServerEvent(eventName, eventId string, eventTime UnixTime, actionSource ActionSource) ServerEvent

func (ServerEvent) WithContents

func (e ServerEvent) WithContents(contents Contents) ServerEvent

func (ServerEvent) WithCustomData

func (e ServerEvent) WithCustomData(customData interface{}) ServerEvent

func (ServerEvent) WithEventSourceURL

func (e ServerEvent) WithEventSourceURL(eventSourceURL string) ServerEvent

func (ServerEvent) WithUserData

func (e ServerEvent) WithUserData(customerInfo CustomerInformation) ServerEvent

type ServerEvents

type ServerEvents []ServerEvent

type UnixTime

type UnixTime int64

Jump to

Keyboard shortcuts

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