gadwords

package module
v0.0.0-...-06005b7 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: MIT Imports: 25 Imported by: 0

README

Usage

The package is comprised of services used to manipulate various adwords structures. To access a service you need to create an gads.Auth and parse it to the service initializer, then can call the service methods on the service object.

     authConf, err := NewCredentialsFromFile("~/creds.json")
     campaignService := gads.NewCampaignService(&authConf.Auth)

     campaigns, totalCount, err := campaignService.Get(
       gads.Selector{
         Fields: []string{
           "Id",
           "Name",
           "Status",
         },
       },
     )

Documentation

Overview

Package gads provides a wrapper for the Google Adwords SOAP API. In order to access the API you will need to sign up for an MMC account[1], get a developer token[2], setup authentication[3]. The is a tool in the setup_oauth2 directory that will setup a configuration file.

The package is comprised of services used to manipulate various adwords structures. To access a service you need to create an gads.Auth and parse it to the service initializer, then can call the service methods on the service object.

authConf, err := NewCredentials(context.TODO())
campaignService := gads.NewCampaignService(&authConf.Auth)

campaigns, totalCount, err := cs.Get(
  gads.Selector{
    Fields: []string{
      "Id",
      "Name",
      "Status",
    },
  },
)

1. http://www.google.com/adwords/myclientcenter/

2. https://developers.google.com/adwords/api/docs/signingup

3. https://developers.google.com/adwords/api/docs/guides/authentication

Index

Constants

This section is empty.

Variables

View Source
var (
	ERROR_NOT_YET_IMPLEMENTED = fmt.Errorf("Not yet implemented")
)

exceptions

Functions

func AddSearchAdGroup

func AddSearchAdGroup(auth *Auth, CampaignId int64)

func AddSearchCampaignCriterion

func AddSearchCampaignCriterion(auth *Auth, CampaignId int64)

func AddSearchKeywords

func AddSearchKeywords(auth *Auth, adGroupId int64)

func CreateAppCampaign

func CreateAppCampaign(budgetId, targetCpa int64, name, appId string)

A campaignService holds the connection information for the campaign service.

func CreateSearchCampaign

func CreateSearchCampaign(name string)

A campaignService holds the connection information for the campaign service.

Types

type AWQLQuery

type AWQLQuery struct {
	XMLName xml.Name
	Query   string `xml:"query"`
}

type AccountLabel

type AccountLabel struct {
	Id   int64  `xml:"id"`
	Name string `xml:"name"`
}

type AdError

type AdError struct {
	FieldPath   string `xml:"fieldPath"`
	Trigger     string `xml:"trigger"`
	ErrorString string `xml:"errorString"`
	Reason      string `xml:"reason"`
}

type AdGroup

type AdGroup struct {
	Id                           int64                          `xml:"id,omitempty"`
	CampaignId                   int64                          `xml:"campaignId,omitempty"`
	CampaignName                 string                         `xml:"campaignName,omitempty"`
	Name                         string                         `xml:"name,omitempty"`
	AdServingOptimizationStatus  string                         `xml:"adServingOptimizationStatus,omitempty"`
	Status                       string                         `xml:"status,omitempty"`
	Settings                     []AdSetting                    `xml:"settings,omitempty"`
	BiddingStrategyConfiguration []BiddingStrategyConfiguration `xml:"biddingStrategyConfiguration,omitempty"`
	ContentBidCriterionTypeGroup *string                        `xml:"contentBidCriterionTypeGroup,omitempty"`
	UrlCustomParameters          *CustomParameters              `xml:"urlCustomParameters,omitempty"`
	Labels                       []Label                        `xml:"labels,omitempty"`
	AdGroupType                  string                         `xml:"adGroupType,omitempty"`
}

type AdGroupAd

type AdGroupAd struct {
	AdGroupId int64       `xml:"adGroupId"` //必填
	Status    string      `xml:"status,omitempty"`
	Ad        interface{} `xml:"ad"`
}

func NewAppAd2

func NewAppAd2(adGroupId int64, headlines, descriptions, images, videos []AssetLink) AdGroupAd

type AdGroupAdLabel

type AdGroupAdLabel struct {
	AdGroupAdId int64 `xml:"adGroupAdId"`
	LabelId     int64 `xml:"labelId"`
}

type AdGroupAdLabelOperations

type AdGroupAdLabelOperations map[string][]AdGroupAdLabel

type AdGroupAdOperations

type AdGroupAdOperations map[string]AdGroupAds

type AdGroupAdService

type AdGroupAdService struct {
	Auth
}

func NewAdGroupAdService

func NewAdGroupAdService(auth *Auth) *AdGroupAdService

func (*AdGroupAdService) CreateAd

func (s *AdGroupAdService) CreateAd(AdGroupId int64, AdType, FinalUrl, Path1, Path2 string, Headlines, Descriptions []string) (adGroupAds AdGroupAds, err error)

func (AdGroupAdService) Get

func (s AdGroupAdService) Get(selector Selector) (adGroupAds AdGroupAds, totalCount int64, err error)

Get returns an array of ad's and the total number of ad's matching the selector.

Example

ads, totalCount, err := adGroupAdService.Get(
  gads.Selector{
    Fields: []string{
      "AdGroupId",
      "Status",
      "AdGroupCreativeApprovalStatus",
      "AdGroupAdDisapprovalReasons",
      "AdGroupAdTrademarkDisapproved",
    },
    Predicates: []gads.Predicate{
      {"AdGroupId", "EQUALS", []string{adGroupId}},
    },
  },
)

Selectable fields are

"AdGroupId", "Id", "Url", "DisplayUrl", "CreativeFinalUrls", "CreativeFinalMobileUrls",
"CreativeFinalAppUrls", "CreativeTrackingUrlTemplate", "CreativeUrlCustomParameters",
"DevicePreference", "Status", "AdGroupCreativeApprovalStatus", "AdGroupAdDisapprovalReasons"
"AdGroupAdTrademarkDisapproved", "Labels"

TextAd
  "Headline", "Description1", "Description2"

ImageAd
  "ImageCreativeName"

filterable fields are

"AdGroupId", "Id", "Url", "DisplayUrl", "CreativeFinalUrls", "CreativeFinalMobileUrls",
"CreativeFinalAppUrls", "CreativeTrackingUrlTemplate", "CreativeUrlCustomParameters",
"DevicePreference", "Status", "AdGroupCreativeApprovalStatus", "AdGroupAdDisapprovalReasons"
"Labels"

TextAd specific fields
  "Headline", "Description1", "Description2"

ImageAd specific fields
  "ImageCreativeName"

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupAdService#get

func (*AdGroupAdService) Mutate

func (s *AdGroupAdService) Mutate(adGroupAdOperations AdGroupAdOperations) (adGroupAds AdGroupAds, err error)

Mutate allows you to add, modify and remove ads, returning the modified ads.

Example

ads, err := adGroupAdService.Mutate(
  gads.AdGroupAdOperations{
    "ADD": {
      gads.NewTextAd(
        adGroup.Id,
        "https://classdo.com/en",
        "classdo.com",
        "test headline",
        "test line one",
        "test line two",
        "PAUSED",
      ),
    },
    "SET": {
      modifiedAd,
    },
    "REMOVE": {
      adNeedingRemoval,
    },
  },
)

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupAdService#mutate

func (*AdGroupAdService) MutateLabel

func (s *AdGroupAdService) MutateLabel(adGroupAdLabelOperations AdGroupAdLabelOperations) (adGroupAdLabels []AdGroupAdLabel, err error)

MutateLabel allows you to add and removes labels from ads.

Example

ads, err := adGroupAdService.MutateLabel(
  gads.AdGroupAdLabelOperations{
    "ADD": {
      gads.AdGroupAdLabel{AdGroupAdId: 3200, LabelId: 5353},
      gads.AdGroupAdLabel{AdGroupAdId: 4320, LabelId: 5643},
    },
    "REMOVE": {
      gads.AdGroupAdLabel{AdGroupAdId: 3653, LabelId: 5653},
    },
  }

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupAdService#mutateLabel

func (*AdGroupAdService) Query

func (s *AdGroupAdService) Query(query string) (adGroupAds AdGroupAds, totalCount int64, err error)

Query is not yet implemented

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupAdService#query

func (*AdGroupAdService) UpdateExpandedTextAd

func (s *AdGroupAdService) UpdateExpandedTextAd(FinalUrl, Path1, Path2 string, Headlines, Descriptions []string) error

func (*AdGroupAdService) UpdateResponsiveSearchAd

func (s *AdGroupAdService) UpdateResponsiveSearchAd(FinalUrl, Path1, Path2 string, Headlines, Descriptions []string) error

func (*AdGroupAdService) UpgradeUrl

func (s *AdGroupAdService) UpgradeUrl(adUrlUpgrades []AdUrlUpgrade) (adGroupAds AdGroupAds, err error)

Query is not yet implemented

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupAdService#upgradeUrl

type AdGroupAds

type AdGroupAds []interface{}

func (AdGroupAds) MarshalXML

func (a1 AdGroupAds) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*AdGroupAds) UnmarshalXML

func (aga *AdGroupAds) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

type AdGroupBidLandscape

type AdGroupBidLandscape struct {
	BidLandscape
	Type             string  `xml:"type"`
	LandscapeCurrent bool    `xml:"landscapeCurrent"`
	Errors           []error `xml:"-"`
}

type AdGroupBidModifierService

type AdGroupBidModifierService struct {
	Auth
}

func NewAdGroupBidModifierService

func NewAdGroupBidModifierService(auth *Auth) *AdGroupBidModifierService

type AdGroupCriterionLabel

type AdGroupCriterionLabel struct {
	AdGroupCriterionId int64 `xml:"adGroupCriterionId"`
	LabelId            int64 `xml:"labelId"`
}

type AdGroupCriterionLabelOperations

type AdGroupCriterionLabelOperations map[string][]AdGroupCriterionLabel

type AdGroupCriterionOperation

type AdGroupCriterionOperation struct {
	Action           string      `xml:"operator"`
	AdGroupCriterion interface{} `xml:"operand"`
}

type AdGroupCriterionOperations

type AdGroupCriterionOperations map[string]AdGroupCriterions

type AdGroupCriterionService

type AdGroupCriterionService struct {
	Auth
}

func NewAdGroupCriterionService

func NewAdGroupCriterionService(auth *Auth) *AdGroupCriterionService

func (AdGroupCriterionService) Get

func (s AdGroupCriterionService) Get(selector Selector) (adGroupCriterions AdGroupCriterions, totalCount int64, err error)

Get returns an array of AdGroupCriterion's and the total number of AdGroupCriterion's matching the selector.

Example

adGroupCriterions, totalCount, err := adGroupCriterionService.Get(
  Selector{
    Fields: []string{"Id","KeywordText","KeywordMatchType"},
    Predicates: []Predicate{
      {"AdGroupId", "EQUALS", []string{"432434"}},
    },
  },
)

Selectable fields are

"AdGroupId", "CriterionUse", "Id", "CriteriaType", "Labels"

AgeRange
  "AgeRangeType",

AppPaymentModel
  "AppPaymentModelType",

CriterionUserInterest
  "UserInterestId", "UserInterestName",

CriterionUserList
  "UserListId", "UserListName", "UserListMembershipStatus"

Gender
  "GenderType"

Keyword
  "KeywordText", "KeywordMatchType"

MobileAppCategory
  "MobileAppCategoryId"

MobileApplication
  "DisplayName"

Placement
  "PlacementUrl"

Product
  "Text"

ProductPartition
  "PartitionType", "ParentCriterionId", "CaseValue"

Vertical
  "VerticalId", "VerticalParentId", "Path"

Webpage
  "Parameter", "CriteriaCoverage", "CriteriaSamples"

filterable fields are

"AdGroupId", "CriterionUse", "Id", "CriteriaType", "Labels"

CriterionUserList
  "UserListMembershipStatus"

Keyword
  "KeywordText", "KeywordMatchType"

MobileApplication
  "DisplayName"

Placement
  "PlacementUrl"

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupCriterionService#get

func (*AdGroupCriterionService) Mutate

func (s *AdGroupCriterionService) Mutate(adGroupCriterionOperations AdGroupCriterionOperations) (adGroupCriterions AdGroupCriterions, err error)

func (*AdGroupCriterionService) MutateLabel

func (s *AdGroupCriterionService) MutateLabel(adGroupCriterionLabelOperations AdGroupCriterionLabelOperations) (adGroupCriterionLabels []AdGroupCriterionLabel, err error)

MutateLabel allows you to add and removes labels from ad groups.

Example

adGroupCriterions, err := adGroupCriterionService.MutateLabel(
  gads.AdGroupCriterionLabelOperations{
    "ADD": {
      gads.AdGroupCriterionLabel{AdGroupCriterionId: 3200, LabelId: 5353},
      gads.AdGroupCriterionLabel{AdGroupCriterionId: 4320, LabelId: 5643},
    },
    "REMOVE": {
      gads.AdGroupCriterionLabel{AdGroupCriterionId: 3653, LabelId: 5653},
    },
  },
)

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupCriterionService#mutateLabel

func (*AdGroupCriterionService) MutateOperations

func (s *AdGroupCriterionService) MutateOperations(operations []AdGroupCriterionOperation) (adGroupCriterions AdGroupCriterions, err error)

func (*AdGroupCriterionService) Query

func (s *AdGroupCriterionService) Query(query string) (adGroupCriterions AdGroupCriterions, totalCount int64, err error)

Query is not yet implemented

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupCriterionService#query

type AdGroupCriterions

type AdGroupCriterions []interface{}

func (*AdGroupCriterions) UnmarshalXML

func (agcs *AdGroupCriterions) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

type AdGroupEstimate

type AdGroupEstimate struct {
	KeywordEstimates []KeywordEstimate `xml:"keywordEstimates"`
}

type AdGroupEstimateRequest

type AdGroupEstimateRequest struct {
	KeywordEstimateRequests []KeywordEstimateRequest `xml:"keywordEstimateRequests"`
	MaxCpc                  int64                    `xml:"https://adwords.google.com/api/adwords/cm/v201809 maxCpc>microAmount"`
}

type AdGroupExperimentData

type AdGroupExperimentData struct {
	ExperimentId          int64  `xml:"experimentId"`
	ExperimentDeltaStatus string `xml:"experimentDeltaStatus"`
	ExperimentDataStatus  string `xml:"experimentDataStatus"`
}

type AdGroupExtensionSetting

type AdGroupExtensionSetting struct {
	AdGroupId        int64            `xml:"https://adwords.google.com/api/adwords/cm/v201809 adGroupId,omitempty"`
	ExtensionType    FeedType         `xml:"https://adwords.google.com/api/adwords/cm/v201809 extensionType,omitempty"`
	ExtensionSetting ExtensionSetting `xml:"https://adwords.google.com/api/adwords/cm/v201809 extensionSetting,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.AdGroupExtensionSetting An AdGroupExtensionSetting is used to add or modify extensions being served for the specified ad group.

type AdGroupExtensionSettingOperations

type AdGroupExtensionSettingOperations map[string][]AdGroupExtensionSetting

type AdGroupFeed

type AdGroupFeed struct {
}

type AdGroupFeedOperations

type AdGroupFeedOperations struct {
}

type AdGroupFeedService

type AdGroupFeedService struct {
	Auth
}

func NewAdGroupFeedService

func NewAdGroupFeedService(auth *Auth) *AdGroupFeedService

func (AdGroupFeedService) Get

func (s AdGroupFeedService) Get(selector Selector) (adGroupFeeds []AdGroupFeed, err error)

Get is not yet implemented

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupFeedService#get

func (*AdGroupFeedService) Mutate

func (s *AdGroupFeedService) Mutate(adGroupFeedOperations AdGroupFeedOperations) (adGroupFeeds []AdGroupFeed, err error)

Mutate is not yet implemented

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupFeedService#mutate

func (*AdGroupFeedService) Query

func (s *AdGroupFeedService) Query(query string) (adGroupFeeds []AdGroupFeed, err error)

Query is not yet implemented

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupFeedService#query

type AdGroupLabel

type AdGroupLabel struct {
	AdGroupId int64 `xml:"adGroupId"`
	LabelId   int64 `xml:"labelId"`
}

type AdGroupLabelOperations

type AdGroupLabelOperations map[string][]AdGroupLabel

type AdGroupOperations

type AdGroupOperations map[string][]AdGroup

type AdGroupService

type AdGroupService struct {
	Auth
}

func NewAdGroupService

func NewAdGroupService(auth *Auth) *AdGroupService

func (*AdGroupService) Get

func (s *AdGroupService) Get(selector Selector) (adGroups []AdGroup, totalCount int64, err error)

Get returns an array of ad group's and the total number of ad group's matching the selector.

Example

ads, totalCount, err := adGroupService.Get(
  gads.Selector{
    Fields: []string{
      "Id",
      "CampaignId",
      "CampaignName",
      "Name",
      "Status",
      "Settings",
      "Labels",
      "ContentBidCriterionTypeGroup",
      "TrackingUrlTemplate",
      "UrlCustomParameters",
    },
    Predicates: []gads.Predicate{
      {"Id", "EQUALS", []string{adGroupId}},
    },
  },
)

Selectable fields are

"Id", "CampaignId", "CampaignName", "Name", "Status", "Settings", "Labels"
"ContentBidCriterionTypeGroup", "TrackingUrlTemplate", "UrlCustomParameters"

filterable fields are

"Id", "CampaignId", "CampaignName", "Name", "Status", "Labels"
"ContentBidCriterionTypeGroup", "TrackingUrlTemplate"

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupService#get

func (*AdGroupService) Mutate

func (s *AdGroupService) Mutate(adGroupOperations AdGroupOperations) (adGroups []AdGroup, err error)

Mutate allows you to add, modify and remove ad group's, returning the modified ad group's.

Example

ads, err := adGroupService.Mutate(
  gads.AdGroupOperations{
    "ADD": {
      gads.AdGroup{
        Name:       "my ad group ",
        Status:     "PAUSED",
        CampaignId:  campaignId,
        BiddingStrategyConfiguration: []gads.BiddingStrategyConfiguration{
          gads.BiddingStrategyConfiguration{
            StrategyType: "MANUAL_CPC",
            Bids: []gads.Bid{
              gads.Bid{
                Type:   "CpcBid",
                Amount: 10000,
              },
            },
          },
        },
      },
    },
    "SET": {
      modifiedAdGroup,
    },
    "REMOVE": {
      adGroupNeedingRemoval,
    },
  },
)

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupService#mutate

func (*AdGroupService) MutateLabel

func (s *AdGroupService) MutateLabel(adGroupLabelOperations AdGroupLabelOperations) (adGroupLabels []AdGroupLabel, err error)

MutateLabel allows you to add and removes labels from ad groups.

Example

adGroups, err := adGroupService.MutateLabel(
  gads.AdGroupLabelOperations{
    "ADD": {
      gads.AdGroupLabel{AdGroupId: 3200, LabelId: 5353},
      gads.AdGroupLabel{AdGroupId: 4320, LabelId: 5643},
    },
    "REMOVE": {
      gads.AdGroupLabel{AdGroupId: 3653, LabelId: 5653},
    },
  }

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupService#mutateLabel

func (*AdGroupService) Query

func (s *AdGroupService) Query(query string) (adGroups []AdGroup, totalCount int64, err error)

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdGroupService#query

type AdGroupServiceError

type AdGroupServiceError struct {
	FieldPath   string `xml:"fieldPath"`
	Trigger     string `xml:"trigger"`
	ErrorString string `xml:"errorString"`
	Reason      string `xml:"reason"`
}

type AdParam

type AdParam struct {
}

type AdParamService

type AdParamService struct {
	Auth
}

func NewAdParamService

func NewAdParamService(auth *Auth) *AdParamService

func (AdParamService) Get

func (s AdParamService) Get(selector Selector) (adParams []AdParam, err error)

Query is not yet implemented

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/AdParamService#get

type AdScheduleCriterion

type AdScheduleCriterion struct {
	Id          int64  `xml:"id,omitempty"`
	DayOfWeek   string `xml:"dayOfWeek"`
	StartHour   string `xml:"startHour"`
	StartMinute string `xml:"startMinute"`
	EndHour     string `xml:"endHour"`
	EndMinute   string `xml:"endMinute"`
}

DayOfWeek: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY StartHour: 0~23 inclusive StartMinute: ZERO, FIFTEEN, THIRTY, FORTY_FIVE EndHour: 0~24 inclusive EndMinute: ZERO, FIFTEEN, THIRTY, FORTY_FIVE

type AdSetting

type AdSetting struct {
	XMLName xml.Name `xml:"settings"`
	Type    string   `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`

	OptIn   *bool                 `xml:"optIn"`
	Details []TargetSettingDetail `xml:"details"`
}

type AdUrlUpgrade

type AdUrlUpgrade struct {
	AdId                int64  `xml:"adId"`
	FinalUrl            string `xml:"finalUrl"`
	FinalMobileUrl      string `xml:"finalMobileUrl"`
	TrackingUrlTemplate string `xml:"trackingUrlTemplate"`
}

type Address

type Address struct {
	StreetAddress  string `xml:"streetAddress"`
	StreetAddress2 string `xml:"streetAddress2"`
	CityName       string `xml:"cityName"`
	ProvinceCode   string `xml:"provinceCode"`
	ProvinceName   string `xml:"provinceName"`
	PostalCode     string `xml:"postalCode"`
	CountryCode    string `xml:"countryCode"`
}

type AdwordsUserListService

type AdwordsUserListService struct {
	Auth
}

func NewAdwordsUserListService

func NewAdwordsUserListService(auth *Auth) *AdwordsUserListService

func (AdwordsUserListService) Get

func (s AdwordsUserListService) Get(selector Selector) (userLists []UserList, err error)

Get returns an array of adwords user lists and the total number of adwords user lists matching the selector.

Example

ads, totalCount, err := adwordsUserListService.Get(
  gads.Selector{
    Fields: []string{
      "Id",
      "Name",
      "Status",
      "Labels",
    },
    Predicates: []gads.Predicate{
      {"Id", "EQUALS", []string{adGroupId}},
    },
  },
)

Selectable fields are

"Id", "IsReadOnly", "Name", "Description", "Status", "IntegrationCode", "AccessReason",
"AccountUserListStatus", "MembershipLifeSpan", "Size", "SizeRange", "SizeForSearch",
"SizeRangeForSearch", "ListType"

BasicUserList
  "ConversionType"

LogicalUserList
  "Rules"

SimilarUserList
  "SeedUserListId", "SeedUserListName", "SeedUserListDescription", "SeedUserListStatus",
  "SeedListSize"

filterable fields are

"Id", "Name", "Status", "IntegrationCode", "AccessReason", "AccountUserListStatus",
"MembershipLifeSpan", "Size", "SizeForSearch", "ListType"

SimilarUserList
  "SeedUserListId", "SeedListSize"

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201809/AdwordsUserListService#get

func (*AdwordsUserListService) Mutate

func (s *AdwordsUserListService) Mutate(userListOperations UserListOperations) (adwordsUserLists []UserList, err error)

Mutate adds/sets a collection of user lists. Returns a list of User Lists

Example

auls := gads.NewAdwordsUserListService(&config.Auth)

crmList := gads.NewCrmBasedUserList("Test List", "Just a list to test with", 0, "http://mytest.com/optout")

ops := gads.UserListOperations{
	Operations: []gads.Operation{
		gads.Operation{
			Operator: "ADD",
			Operand: crmList,
		},
	},
}

resp, err := auls.Mutate(ops)

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201809/AdwordsUserListService#mutate

func (*AdwordsUserListService) MutateMembers

func (s *AdwordsUserListService) MutateMembers(mutateMembersOperations MutateMembersOperations) (adwordsUserLists []UserList, err error)
mutateMembersOperations := gads.MutateMembersOperations{
	Operations: []gads.Operation{
		gads.Operation{
			Operator: "ADD",
			Operand: mmo,
		},
	},
}

auls.MutateMembers(mutateMembersOperations)

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201809/AdwordsUserListService#mutateMembers

type AgeRangeCriterion

type AgeRangeCriterion struct {
	Id           int64  `xml:"id,omitempty"`
	AgeRangeType string `xml:"ageRangeType"`
}

AgeRangeType: AGE_RANGE_18_24, AGE_RANGE_25_34, AGE_RANGE_35_44, AGE_RANGE_45_54, AGE_RANGE_55_64, AGE_RANGE_65_UP, AGE_RANGE_UNDETERMINED, UNKNOWN

type ApiError

type ApiError struct {
	Type string `xml:"type"`
}

type is equiv to errorString eg AuthorizationError.USER_PERMISSION_DENIED

func (ApiError) Code

func (s ApiError) Code() string

func (ApiError) Error

func (s ApiError) Error() string

type ApiExceptionFault

type ApiExceptionFault struct {
	Message    string `xml:"message"`
	Type       string `xml:"ApplicationException.Type"`
	ErrorsType string
	Reason     string
	Errors     []interface{} `xml:"errors"`
}

func (*ApiExceptionFault) UnmarshalXML

func (aes *ApiExceptionFault) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) (err error)

type AppAd

type AppAd struct {
	AdGroupId int64 `xml:"-"`
	//Type                string            `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id                  int64             `xml:"id,omitempty"`
	Url                 string            `xml:"url,omitempty"`
	DisplayUrl          string            `xml:"displayUrl,omitempty"`
	FinalUrls           []string          `xml:"finalUrls,omitempty"`
	FinalMobileUrls     []string          `xml:"finalMobileUrls,omitempty"`
	FinalAppUrls        []AppUrl          `xml:"finalAppUrls,omitempty"`
	TrackingUrlTemplate string            `xml:"trackingUrlTemplate,omitempty"`
	FinalUrlSuffix      string            `xml:"finalUrlSuffix,omitempty"`
	UrlCustomParameters *CustomParameters `xml:"urlCustomParameters,omitempty"`
	DevicePreference    int64             `xml:"devicePreference,omitempty"`
	Headlines           []AssetLink       `xml:"headlines,omitempty"`
	Descriptions        []AssetLink       `xml:"descriptions,omitempty"`
	Images              []AssetLink       `xml:"images,omitempty"`
	Videos              []AssetLink       `xml:"videos,omitempty"`
	Labels              []Label           `xml:"-"`
}

func NewAppAd

func NewAppAd(adGroupId int64, headlines, descriptions, images, videos []AssetLink) AppAd

type AppUrl

type AppUrl struct {
	Url    string `xml:"url"`
	OsType string `xml:"osType"` // "OS_TYPE_IOS", "OS_TYPE_ANDROID", "UNKNOWN"
}

type Asset

type Asset struct {
	Type           string        `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id             int64         `xml:"assetId,omitempty"`
	AssetName      string        `xml:"assetName,omitempty"`
	ImageData      string        `xml:"imageData,omitempty"`
	AssetText      string        `xml:"assetText,omitempty"`
	YouTubeVideoId string        `xml:"youTubeVideoId,omitempty"`
	FullSizeInfo   *FullSizeInfo `xml:"fullSizeInfo,omitempty"`
}

Media represents an audio, image or video file.

func NewImageAsset

func NewImageAsset(name string, data []byte) Asset

func NewTextAsset

func NewTextAsset(text string) Asset

func NewYouTubeVideoAsset

func NewYouTubeVideoAsset(name string, youTubeVideoId string) Asset
type AssetLink struct {
	Asset Asset `xml:"asset,omitempty"`
}

type AssetOperations

type AssetOperations map[string][]Asset

type AssetsService

type AssetsService struct {
	Auth
}

func NewAssetsService

func NewAssetsService(auth *Auth) *AssetsService

func (*AssetsService) Get

func (s *AssetsService) Get(selector Selector) (assets []Asset, totalCount int64, err error)

func (*AssetsService) Mutate

func (s *AssetsService) Mutate(assetOperations AssetOperations) (assets []Asset, err error)

type Attribute

type Attribute interface{}

type Auth

type Auth struct {
	CustomerId     string
	DeveloperToken string
	UserAgent      string
	PartialFailure bool
	ValidateOnly   bool
	Testing        *testing.T `json:"-"`
	Client         HttpClient `json:"-"`
}

type AuthConfig

type AuthConfig struct {
	OAuth2Config *oauth2.Config `json:"oauth2.Config"`
	OAuth2Token  *oauth2.Token  `json:"oauth2.Token"`

	Auth Auth `json:"gads.Auth"`
	// contains filtered or unexported fields
}

func NewCredentialsFromFile

func NewCredentialsFromFile(pathToFile string) (ac AuthConfig, err error)

func NewCredentialsFromParams

func NewCredentialsFromParams(creds Credentials) (config AuthConfig, err error)

func (*AuthConfig) Init

func (ac *AuthConfig) Init()

func (AuthConfig) Save

func (c AuthConfig) Save() error

Save writes the contents of AuthConfig back to the JSON file it was loaded from.

func (*AuthConfig) Scan

func (w *AuthConfig) Scan(src interface{}) error

Scan 数据库

func (AuthConfig) Token

func (c AuthConfig) Token() (token *oauth2.Token, err error)

Token implements oauth2.TokenSource interface and store updates to config file.

func (AuthConfig) Value

func (w AuthConfig) Value() (driver.Value, error)

type BatchJob

type BatchJob struct {
	Id               int64                    `xml:"id,omitempty" json:",string"`
	Status           string                   `xml:"status,omitempty"`
	ProgressStats    *ProgressStats           `xml:"progressStats,omitempty"`
	UploadUrl        *TemporaryUrl            `xml:"uploadUrl,omitempty"`
	DownloadUrl      *TemporaryUrl            `xml:"downloadUrl,omitempty"`
	ProcessingErrors *BatchJobProcessingError `xml:"processingErrors,omitempty"`
}

type BatchJobHelper

type BatchJobHelper struct {
	Auth
}

func NewBatchJobHelper

func NewBatchJobHelper(auth *Auth) *BatchJobHelper

func (*BatchJobHelper) DownloadBatchJob

func (s *BatchJobHelper) DownloadBatchJob(url TemporaryUrl) (mutateResults []MutateResults, err error)

DownloadBatchJob download batch operations from an BatchJob.DownloadUrl from BatchJobService.Get

Example

mutateResult, err := batchJobHelper.DownloadBatchJob(*batchJobs.BatchJobs[0].DownloadUrl)

https://developers.google.com/adwords/api/docs/guides/batch-jobs?hl=en#download_the_batch_job_results_and_check_for_errors

func (*BatchJobHelper) UploadBatchJobOperations

func (s *BatchJobHelper) UploadBatchJobOperations(jobOperations []interface{}, url TemporaryUrl) (err error)

UploadBatchJobOperations uploads batch operations to an BatchJob.UploadUrl from BatchJobService.Mutate

Example

ago := gads.AdGroupOperations{
		"ADD": {
			gads.AdGroup{
				Name:       "test ad group " + rand_str(10),
				Status:     "PAUSED",
				CampaignId: campaignId,
			},
			gads.AdGroup{
				Name:       "test ad group " + rand_str(10),
				Status:     "PAUSED",
				CampaignId: campaignId,
			},
		},
	}

var operations []interface{} operations = append(operations, ago) err = batchJobHelper.UploadBatchJobOperations(operations, UploadUrl)

https://developers.google.com/adwords/api/docs/guides/batch-jobs?hl=en#upload_operations_to_the_upload_url

type BatchJobOperation

type BatchJobOperation struct {
	Operator string   `xml:"operator"`
	Operand  BatchJob `xml:"operand"`
}

type BatchJobOperations

type BatchJobOperations struct {
	BatchJobOperations []BatchJobOperation
}

type BatchJobPage

type BatchJobPage struct {
	TotalNumEntries int        `xml:"rval>totalNumEntries"`
	BatchJobs       []BatchJob `xml:"rval>entries"`
}

type BatchJobProcessingError

type BatchJobProcessingError struct {
	FieldPath   string `xml:"fieldPath"`
	Trigger     string `xml:"trigger"`
	ErrorString string `xml:"errorString"`
	Reason      string `xml:"reason"`
}

type BatchJobService

type BatchJobService struct {
	Auth
}

func NewBatchJobService

func NewBatchJobService(auth *Auth) *BatchJobService

func (*BatchJobService) Get

func (s *BatchJobService) Get(selector Selector) (batchJobPage BatchJobPage, err error)

Get queries the status of existing BatchJobs

Example

batchJobs, err := batchJobService.Get(
	gads.Selector{
		Fields: []string{
			"Id",
			"Status",
			"DownloadUrl",
			"ProcessingErrors",
			"ProgressStats",
		},
		Predicates: []gads.Predicate{
			{"Id", "EQUALS", []string{strconv.FormatInt(jobId, 10)}},
		},
	},
)

https://developers.google.com/adwords/api/docs/reference/v201809/BatchJobService#get

func (*BatchJobService) Mutate

func (s *BatchJobService) Mutate(batchJobOperations BatchJobOperations) (batchJobs []BatchJob, err error)

Mutate allows you to create or update a BatchJob

Example

resp, err := batchJobService.Mutate(
	gads.BatchJobOperations{
		BatchJobOperations: []gads.BatchJobOperation{
			gads.BatchJobOperation{
				Operator: "ADD",
				Operand: gads.BatchJob{},
			},
		},
	},
)

https://developers.google.com/adwords/api/docs/reference/v201809/BatchJobService#mutate

func (*BatchJobService) Query

func (s *BatchJobService) Query()

type Bid

type Bid struct {
	Type         string  `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Amount       int64   `xml:"bid>microAmount"`
	CpcBidSource *string `xml:"cpcBidSource"`
	CpmBidSource *string `xml:"cpmBidSource"`
}

type BidLandscape

type BidLandscape struct {
	CampaignId      *int64           `xml:"campaignId,omitempty"`
	AdGroupId       *int64           `xml:"adGroupId,omitempty"`
	StartDate       *string          `xml:"startDate,omitempty"`
	EndDate         *string          `xml:"endDate,omitempty"`
	LandscapePoints []LandscapePoint `xml:"landscapePoints"`
}

type BiddableAdGroupCriterion

type BiddableAdGroupCriterion struct {
	AdGroupId    int64     `xml:"adGroupId,omitempty"`
	CriterionUse string    `xml:"criterionUse,omitempty"`
	Criterion    Criterion `xml:"criterion,omitempty"`

	// BiddableAdGroupCriterion
	UserStatus          string   `xml:"userStatus,omitempty"`
	SystemServingStatus string   `xml:"systemServingStatus,omitempty"`
	ApprovalStatus      string   `xml:"approvalStatus,omitempty"`
	DisapprovalReasons  []string `xml:"disapprovalReasons,omitempty"`
	DestinationUrl      string   `xml:"destinationUrl,omitempty"`

	// TODO add ExperimentData
	FirstPageCpc *Cpc `xml:"firstPageCpc,omitempty"`
	TopOfPageCpc *Cpc `xml:"topOfPageCpc,omitempty"`

	QualityInfo *QualityInfo `xml:"qualityInfo,omitempty"`

	BiddingStrategyConfiguration *BiddingStrategyConfiguration `xml:"biddingStrategyConfiguration,omitempty"`
	BidModifier                  float64                       `xml:"bidModifier,omitempty"`

	FinalUrls           []string         `xml:"finalUrls,omitempty"`
	FinalMobileUrls     []string         `xml:"finalMobileUrls,omitempty"`
	FinalAppUrls        []string         `xml:"finalAppUrls,omitempty"`
	TrackingUrlTemplate string           `xml:"trackingUrlTemplate,omitempty"`
	UrlCustomParameters CustomParameters `xml:"urlCustomParameters,omitempty"`
	Labels              []Label          `xml:"labels,omitempty"`
}

func (BiddableAdGroupCriterion) MarshalXML

func (bagc BiddableAdGroupCriterion) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*BiddableAdGroupCriterion) UnmarshalXML

func (bagc *BiddableAdGroupCriterion) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

type BiddingScheme

type BiddingScheme struct {
	Type               string     `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	EnhancedCpcEnabled bool       `xml:"enhancedCpcEnabled,omitempty"`
	TargetCpa          *TargetCpa `xml:"targetCpa,omitempty"`
	BidCeiling         *TargetCpa `xml:"bidCeiling,omitempty"`
}

type BiddingStrategyConfiguration

type BiddingStrategyConfiguration struct {
	StrategyId     int64          `xml:"biddingStrategyId,omitempty"`
	StrategyName   string         `xml:"biddingStrategyName,omitempty"`
	StrategyType   string         `xml:"biddingStrategyType,omitempty"`
	StrategySource string         `xml:"biddingStrategySource,omitempty"`
	Scheme         *BiddingScheme `xml:"biddingScheme,omitempty"`
	Bids           []Bid          `xml:"bids,omitempty"`
}

type BiddingStrategyService

type BiddingStrategyService struct {
	Auth
}

func NewBiddingStrategyService

func NewBiddingStrategyService(auth *Auth) *BiddingStrategyService

type BooleanAttribute

type BooleanAttribute struct {
	Value bool `xml:"value"`
}

type Budget

type Budget struct {
	Id         int64  `xml:"budgetId,omitempty"`           // A unique identifier
	Name       string `xml:"name,omitempty"`               // A descriptive name
	Period     string `xml:"period,omitempty"`             // The period to spend the budget
	Amount     int64  `xml:"amount>microAmount,omitempty"` // The amount in cents
	Delivery   string `xml:"deliveryMethod,omitempty"`     // The rate at which the budget spent. valid options are STANDARD or ACCELERATED.
	References int64  `xml:"referenceCount,omitempty"`     // The number of campaigns using the budget
	Shared     bool   `xml:"isExplicitlyShared,omitempty"` // If this budget was created to be shared across campaigns
	Status     string `xml:"status,omitempty"`             // The status of the budget. can be ENABLED, REMOVED, UNKNOWN
}

A Budget represents an allotment of money to be spent over a fixed period of time.

type BudgetError

type BudgetError struct {
	EntityError
}

type BudgetOperations

type BudgetOperations map[string][]Budget

A BudgetOperations maps operations to the budgets they will be performed on. Budgets operations can be 'ADD', 'REMOVE' or 'SET'

type BudgetOrderService

type BudgetOrderService struct {
	Auth
}

func NewBudgetOrderService

func NewBudgetOrderService(auth *Auth) *BudgetOrderService

type BudgetService

type BudgetService struct {
	Auth
}

A budgetService holds the connection information for the budget service.

func NewBudgetService

func NewBudgetService(auth *Auth) *BudgetService

NewBudgetService creates a new budgetService

func (*BudgetService) Get

func (s *BudgetService) Get(selector Selector) (budgets []Budget, totalCount int64, err error)

Get returns budgets matching a given selector and the total count of matching budgets.

func (*BudgetService) Mutate

func (s *BudgetService) Mutate(budgetOperations BudgetOperations) (budgets []Budget, err error)

Mutate takes a budgetOperations and creates, modifies or destroys the associated budgets.

type CallConversionType

type CallConversionType struct {
	ConversionTypeId int64 `xml:"https://adwords.google.com/api/adwords/cm/v201809 conversionTypeId,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.CallConversionType Conversion type for a call extension.

type CallFeedItem

type CallFeedItem struct {
	ExtensionFeedItem

	CallPhoneNumber               string             `xml:"https://adwords.google.com/api/adwords/cm/v201809 callPhoneNumber,omitempty"`
	CallCountryCode               string             `xml:"https://adwords.google.com/api/adwords/cm/v201809 callCountryCode,omitempty"`
	CallTracking                  bool               `xml:"https://adwords.google.com/api/adwords/cm/v201809 callTracking,omitempty"`
	CallConversionType            CallConversionType `xml:"https://adwords.google.com/api/adwords/cm/v201809 callConversionType,omitempty"`
	DisableCallConversionTracking bool               `xml:"https://adwords.google.com/api/adwords/cm/v201809 disableCallConversionTracking,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.CallFeedItem Represents a Call extension.

type Campaign

type Campaign struct {
	Id                             int64                           `xml:"id,omitempty"`
	Name                           string                          `xml:"name,omitempty"`
	BudgetAmount                   int64                           `xml:"-"`
	Status                         string                          `xml:"status,omitempty"`        // Status: "ENABLED", "PAUSED", "REMOVED"
	ServingStatus                  *string                         `xml:"servingStatus,omitempty"` // ServingStatus: "SERVING", "NONE", "ENDED", "PENDING", "SUSPENDED"
	StartDate                      string                          `xml:"startDate,omitempty"`
	EndDate                        string                          `xml:"endDate,omitempty"`
	BudgetId                       int64                           `xml:"budget>budgetId,omitempty"`
	BudgetDeliveryMethod           string                          `xml:"-"`
	ConversionOptimizerEligibility *conversionOptimizerEligibility `xml:"conversionOptimizerEligibility,omitempty"`
	AdServingOptimizationStatus    string                          `xml:"adServingOptimizationStatus,omitempty"`
	FrequencyCap                   *FrequencyCap                   `xml:"frequencyCap,omitempty"`
	Settings                       []CampaignSetting               `xml:"settings,omitempty"`
	AdvertisingChannelType         string                          `xml:"advertisingChannelType,omitempty"`    // "UNKNOWN", "SEARCH", "DISPLAY", "SHOPPING"
	AdvertisingChannelSubType      string                          `xml:"advertisingChannelSubType,omitempty"` // "UNKNOWN", "SEARCH_MOBILE_APP", "DISPLAY_MOBILE_APP", "SEARCH_EXPRESS", "DISPLAY_EXPRESS"
	NetworkSetting                 *NetworkSetting                 `xml:"networkSetting,omitempty"`
	Labels                         []Label                         `xml:"labels,omitempty"`
	BiddingStrategyConfiguration   *BiddingStrategyConfiguration   `xml:"biddingStrategyConfiguration,omitempty"`
	ForwardCompatibilityMap        *map[string]string              `xml:"forwardCompatibilityMap,omitempty"`
	TrackingUrlTemplate            *string                         `xml:"trackingUrlTemplate,omitempty"`
	UrlCustomParameters            *CustomParameters               `xml:"urlCustomParameters,omitempty"`
	Errors                         []error                         `xml:"-"`
	UniversalAppCampaignInfo       *CampaignAppSetting             `xml:"universalAppCampaignInfo,omitempty"`
}

type CampaignAppSetting

type CampaignAppSetting struct {
	UniversalAppBiddingStrategyGoalType string `xml:"biddingStrategyGoalType,omitempty"`
	AppId                               string `xml:"appId,omitempty"`
	AppVendor                           string `xml:"appVendor,omitempty"`
	Description1                        string `xml:"description1,omitempty"`
	Description2                        string `xml:"description2,omitempty"`
	Description3                        string `xml:"description3,omitempty"`
	Description4                        string `xml:"description4,omitempty"`
}

type CampaignCriterion

type CampaignCriterion struct {
	CampaignId  int64     `xml:"campaignId"`
	IsNegative  bool      `xml:"isNegative,omitempty"`
	Criterion   Criterion `xml:"criterion"`
	BidModifier *float64  `xml:"bidModifier,omitempty"`
	Errors      []error   `xml:"-"`
}

func (CampaignCriterion) MarshalXML

func (cc CampaignCriterion) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type CampaignCriterionOperations

type CampaignCriterionOperations map[string]CampaignCriterions

type CampaignCriterionService

type CampaignCriterionService struct {
	Auth
}

func NewCampaignCriterionService

func NewCampaignCriterionService(auth *Auth) *CampaignCriterionService

func (*CampaignCriterionService) Get

func (s *CampaignCriterionService) Get(selector Selector) (campaignCriterions CampaignCriterions, totalCount int64, err error)

func (*CampaignCriterionService) GetScheduleCriterions

func (s *CampaignCriterionService) GetScheduleCriterions(selector Selector) (campaignCriterions []CampaignScheduleCriterion, totalCount int64, err error)

func (*CampaignCriterionService) Mutate

func (s *CampaignCriterionService) Mutate(campaignCriterionOperations CampaignCriterionOperations) (campaignCriterions CampaignCriterions, err error)

func (*CampaignCriterionService) Query

func (s *CampaignCriterionService) Query(query string) (campaignCriterions CampaignCriterions, totalCount int64, err error)

func (*CampaignCriterionService) SetSchedule

func (s *CampaignCriterionService) SetSchedule(campaignid int64, start, end int) error

type CampaignCriterions

type CampaignCriterions []interface{}

func GenScheduleCriterions

func GenScheduleCriterions(campaignid int64, start, end int) CampaignCriterions

func (*CampaignCriterions) UnmarshalXML

func (ccs *CampaignCriterions) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

type CampaignEstimate

type CampaignEstimate struct {
	AdGroupEstimates []AdGroupEstimate `xml:"adGroupEstimates"`
}

type CampaignEstimateRequest

type CampaignEstimateRequest struct {
	AdGroupEstimateRequests []AdGroupEstimateRequest `xml:"adGroupEstimateRequests"`
}

type CampaignExtensionSetting

type CampaignExtensionSetting struct {
	CampaignId       int64            `xml:"https://adwords.google.com/api/adwords/cm/v201809 campaignId,omitempty"`
	ExtensionType    FeedType         `xml:"https://adwords.google.com/api/adwords/cm/v201809 extensionType,omitempty"`
	ExtensionSetting ExtensionSetting `xml:"https://adwords.google.com/api/adwords/cm/v201809 extensionSetting,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/CampaignExtensionSettingService.CampaignExtensionSetting A CampaignExtensionSetting is used to add or modify extensions being served for the specified campaign.

type CampaignExtensionSettingOperations

type CampaignExtensionSettingOperations map[string][]CampaignExtensionSetting

type CampaignFeedService

type CampaignFeedService struct {
	Auth
}

func NewCampaignFeedService

func NewCampaignFeedService(auth *Auth) *CampaignFeedService

type CampaignLabel

type CampaignLabel struct {
	CampaignId int64 `xml:"campaignId"`
	LabelId    int64 `xml:"labelId"`
}

type CampaignLabelOperations

type CampaignLabelOperations map[string][]CampaignLabel

type CampaignOperations

type CampaignOperations map[string][]Campaign

type CampaignScheduleCriterion

type CampaignScheduleCriterion struct {
	CampaignId  int64               `xml:"campaignId"`
	IsNegative  bool                `xml:"isNegative,omitempty"`
	Criterion   AdScheduleCriterion `xml:"criterion"`
	BidModifier *float64            `xml:"bidModifier,omitempty"`
	Errors      []error             `xml:"-"`
}

type CampaignService

type CampaignService struct {
	Auth
}

A campaignService holds the connection information for the campaign service.

func NewCampaignService

func NewCampaignService(auth *Auth) *CampaignService

NewCampaignService creates a new campaignService

func (*CampaignService) Get

func (s *CampaignService) Get(selector Selector) (campaigns []Campaign, totalCount int64, err error)

Get returns an array of Campaign's and the total number of campaign's matching the selector.

Example

campaigns, totalCount, err := campaignService.Get(
  gads.Selector{
    Fields: []string{
      "AdGroupId",
      "Status",
      "AdGroupCreativeApprovalStatus",
      "AdGroupAdDisapprovalReasons",
      "AdGroupAdTrademarkDisapproved",
    },
    Predicates: []gads.Predicate{
      {"AdGroupId", "EQUALS", []string{adGroupId}},
    },
  },
)

Selectable fields are

"Id", "Name", "Status", "ServingStatus", "StartDate", "EndDate",
"Settings", "AdvertisingChannelType", "AdvertisingChannelSubType", "Labels", "TrackingUrlTemplate",
"UrlCustomParameters"

filterable fields are

"Id", "Name", "Status", "ServingStatus", "StartDate", "EndDate", "AdvertisingChannelType",
"AdvertisingChannelSubType", "Labels", "TrackingUrlTemplate"

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/CampaignService#get

func (*CampaignService) Mutate

func (s *CampaignService) Mutate(campaignOperations CampaignOperations) (campaigns []Campaign, err error)

Mutate allows you to add and modify campaigns, returning the campaigns. Note that the "REMOVE" operator is not supported. To remove a campaign set its Status to "REMOVED".

Example

campaignNeedingRemoval.Status = "REMOVED"
ads, err := campaignService.Mutate(
  gads.CampaignOperations{
    "ADD": {
      gads.Campaign{
        Name: "my campaign name",
        Status: "PAUSED",
        StartDate: time.Now().Format("20060102"),
        BudgetId: 321543214,
        Settings: []gads.CampaignSetting{
          gads.NewRealTimeBiddingSetting(true),
        },
        AdvertisingChannelType: "SEARCH",
        BiddingStrategyConfiguration: &gads.BiddingStrategyConfiguration{
          StrategyType: "MANUAL_CPC",
        },
      },
      campaignNeedingRemoval,
    },
    "SET": {
      modifiedCampaign,
    },
  }

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/CampaignService#mutate

func (*CampaignService) MutateLabel

func (s *CampaignService) MutateLabel(campaignLabelOperations CampaignLabelOperations) (campaignLabels []CampaignLabel, err error)

Mutate allows you to add and removes labels from campaigns.

Example

cls, err := campaignService.MutateLabel(
  gads.CampaignOperations{
    "ADD": {
      gads.CampaignLabel{CampaignId: 3200, LabelId: 5353},
      gads.CampaignLabel{CampaignId: 4320, LabelId: 5643},
    },
    "REMOVE": {
      gads.CampaignLabel{CampaignId: 3653, LabelId: 5653},
    },
  }

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/CampaignService#mutateLabel

func (*CampaignService) Query

func (s *CampaignService) Query(query string) (campaigns []Campaign, totalCount int64, err error)

Query is not yet implemented

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/CampaignService#query

type CampaignSetting

type CampaignSetting struct {
	XMLName xml.Name `xml:"settings"`
	Type    string   `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	//Type2   string   `xml:"Setting.Type"`
	// GeoTargetTypeSetting
	PositiveGeoTargetType *string `xml:"positiveGeoTargetType,omitempty"`
	NegativeGeoTargetType *string `xml:"negativeGeoTargetType,omitempty"`

	// RealTimeBiddingSetting
	OptIn *bool `xml:"optIn,omitempty"`

	// DynamicSearchAdsSetting
	DomainName   *string `xml:"domainName,omitempty"`
	LanguageCode *string `xml:"langaugeCode,omitempty"`

	// TrackingSetting
	TrackingUrl                         *string         `xml:"trackingUrl,omitempty"`
	AppId                               string          `xml:"appId,omitempty"`
	AppVendor                           string          `xml:"appVendor,omitempty"`
	Description1                        string          `xml:"description1,omitempty"`
	Description2                        string          `xml:"description2,omitempty"`
	Description3                        string          `xml:"description3,omitempty"`
	Description4                        string          `xml:"description4,omitempty"`
	UniversalAppBiddingStrategyGoalType string          `xml:"universalAppBiddingStrategyGoalType,omitempty"`
	Details                             []TargetDetails `xml:"details,omitempty"`
}

func NewDynamicSearchAdsSetting

func NewDynamicSearchAdsSetting(domainName, languageCode string) CampaignSetting

func NewGeoTargetTypeSetting

func NewGeoTargetTypeSetting(positiveGeoTargetType, negativeGeoTargetType string) CampaignSetting

func NewRealTimeBiddingSetting

func NewRealTimeBiddingSetting(optIn bool) CampaignSetting

func NewTrackingSetting

func NewTrackingSetting(trackingUrl string) CampaignSetting

type CampaignSharedSet

type CampaignSharedSet struct {
	SharedSetId   int64  `xml:"sharedSetId,omitempty"`
	CampaignId    int64  `xml:"campaignId"`
	SharedSetName string `xml:"sharedSetName"`
	SharedSetType string `xml:"sharedSetType"`
	CampaignName  string `xml:"campaignName"`
	Status        string `xml:"status"`
}

type CampaignSharedSetOperation

type CampaignSharedSetOperation struct {
	Operator string            `xml:"operator,omitempty"`
	Operand  CampaignSharedSet `xml:"operand,omitempty"`
}

type CampaignSharedSetService

type CampaignSharedSetService struct {
	Auth
}

func NewCampaignSharedSetService

func NewCampaignSharedSetService(auth *Auth) *CampaignSharedSetService

func (CampaignSharedSetService) Get

func (s CampaignSharedSetService) Get(selector Selector) (sharedSets []CampaignSharedSet, totalCount int64, err error)

func (CampaignSharedSetService) Mutate

type CarrierCriterion

type CarrierCriterion struct {
	Id          int64  `xml:"id,omitempty"`
	Name        string `xml:"name,emitempty"`
	CountryCode string `xml:"countryCode,emitempty"`
}

type CategoryProductsAndServicesSearchParameter

type CategoryProductsAndServicesSearchParameter struct {
	CategoryID int `xml:"categoryId"`
}

type CompetitionSearchParameter

type CompetitionSearchParameter struct {
	Levels []string `xml:"levels"`
}

type ConstantDataService

type ConstantDataService struct {
	Auth
}

func NewConstantDataService

func NewConstantDataService(auth *Auth) *ConstantDataService

func (*ConstantDataService) GetAgeRangeCriterion

func (s *ConstantDataService) GetAgeRangeCriterion() (ageRanges []AgeRangeCriterion, err error)

func (*ConstantDataService) GetCarrierCriterion

func (s *ConstantDataService) GetCarrierCriterion() (carriers []CarrierCriterion, err error)

func (*ConstantDataService) GetGenderCriterion

func (s *ConstantDataService) GetGenderCriterion() (genders []GenderCriterion, err error)

func (*ConstantDataService) GetLanguageCriterion

func (s *ConstantDataService) GetLanguageCriterion() (languages []LanguageCriterion, err error)

func (*ConstantDataService) GetMobileDeviceCriterion

func (s *ConstantDataService) GetMobileDeviceCriterion() (mobileDevices []MobileDeviceCriterion, err error)

func (*ConstantDataService) GetOperatingSystemVersionCriterion

func (s *ConstantDataService) GetOperatingSystemVersionCriterion() (operatingSystemVersions []OperatingSystemVersionCriterion, err error)

func (*ConstantDataService) GetProductBiddingCategoryCriterion

func (s *ConstantDataService) GetProductBiddingCategoryCriterion(selector Selector) (categoryData []ProductBiddingCategoryData, err error)

func (*ConstantDataService) GetUserInterestCriterion

func (s *ConstantDataService) GetUserInterestCriterion() (userInterests []UserInterestCriterion, err error)

func (*ConstantDataService) GetVerticalCriterion

func (s *ConstantDataService) GetVerticalCriterion() (verticals []VerticalCriterion, err error)

type ContentLabelCriterion

type ContentLabelCriterion struct {
	Id               int64  `xml:"id,omitempty"`
	ContentLabelType string `xml:"contentLabelType"` // ContentLabelType: "ADULTISH", "AFE", "BELOW_THE_FOLD", "CONFLICT", "DP", "EMBEDDED_VIDEO", "GAMES", "JACKASS", "PROFANITY", "UGC_FORUMS", "UGC_IMAGES", "UGC_SOCIAL", "UGC_VIDEOS", "SIRENS", "TRAGEDY", "VIDEO", "UNKNOWN"
}

type ConversionTracker

type ConversionTracker struct {
	Id       int64  `xml:"id,omitempty"`
	Name     string `xml:"name,omitempty"`
	Category string `xml:"category,omitempty"`
	Status   string `xml:"status,omitempty"`
}

type ConversionTrackerService

type ConversionTrackerService struct {
	Auth
}

func NewConversionTrackerService

func NewConversionTrackerService(auth *Auth) *ConversionTrackerService

func (*ConversionTrackerService) Get

func (s *ConversionTrackerService) Get(selector Selector) (ConversionTrackers []ConversionTracker, totalCount int64, err error)

type ConversionTrackingSettings

type ConversionTrackingSettings struct {
	EffectiveConversionTrackingId      int64 `xml:effectiveConversionTrackingId`
	UsesCrossAccountConversionTracking bool  `xml:usesCrossAccountConversionTracking`
}

type Cpc

type Cpc struct {
	Amount *CpcAmount `xml:"amount,omitempty"`
}

type CpcAmount

type CpcAmount struct {
	MicroAmount int64 `xml:"microAmount,omitempty"`
}

type Credentials

type Credentials struct {
	Config OAuthConfigArgs
	Token  OAuthTokenArgs
	Auth   Auth
}

type Criterion

type Criterion interface{}

type CriterionBidLandscape

type CriterionBidLandscape struct {
	BidLandscape
	CriterionId *int64 `xml:"criterionId,omitempty"`
}

type CriterionError

type CriterionError struct {
	EntityError
}

type CustomParameter

type CustomParameter struct {
	Key      string `xml:"key"`
	Value    string `xml:"value"`
	IsRemove bool   `xml:"isRemove"`
}

type CustomParameters

type CustomParameters struct {
	CustomParameters []CustomParameter `xml:"parameters"`
	DoReplace        bool              `xml:"doReplace"`
}

type Customer

type Customer struct {
	CustomerId      int64  `xml:"customerId,omitempty"`
	CurrencyCode    string `xml:"currencyCode,omitempty"`
	DateTimeZone    string `xml:"dateTimeZone,omitempty"`
	DescriptiveName string `xml:"descriptiveName,omitempty"`
	/* 	CanManageClients           bool                       `xml:"canManageClients"`
	   	TestAccount                bool                       `xml:"testAccount"` */
	AutoTaggingEnabled         bool                        `xml:"autoTaggingEnabled"`
	TrackingUrlTemplate        string                      `xml:"trackingUrlTemplate,omitempty"`
	ConversionTrackingSettings *ConversionTrackingSettings `xml:"conversionTrackingSettings,omitempty"`
	RemarketingSettings        *RemarketingSettings        `xml:"remarketingSettings,omitempty"`
}

type CustomerFeedService

type CustomerFeedService struct {
	Auth
}

func NewCustomerFeedService

func NewCustomerFeedService(auth *Auth) *CustomerFeedService

type CustomerOperations

type CustomerOperations map[string]Customer

type CustomerService

type CustomerService struct {
	Auth
}

func NewCustomerService

func NewCustomerService(auth *Auth) *CustomerService

func (*CustomerService) GetCustomers

func (s *CustomerService) GetCustomers() (customers []Customer, err error)
func (s *CustomerService) GetServiceLinks(selector Selector) (links []ServiceLink, err error)

func (*CustomerService) Mutate

func (s *CustomerService) Mutate(customerOperations CustomerOperations) (customers []Customer, err error)

type CustomerSyncService

type CustomerSyncService struct {
	Auth
}

func NewCustomerSyncService

func NewCustomerSyncService(auth *Auth) *CustomerSyncService

type DataService

type DataService struct {
	Auth
}

func NewDataService

func NewDataService(auth *Auth) *DataService

func (*DataService) GetAdGroupBidLandscape

func (s *DataService) GetAdGroupBidLandscape(selector Selector) (adGroupBidLandscapes []AdGroupBidLandscape, totalCount int64, err error)

GetAdGroupBidLandscape returns an array of AdGroupBidLandscape objects the selector.

Example

  adGroupBidLandscape, totalCount, err := dataService.GetAdGroupBidLandscape(
    gads.Selector{
      Fields: []string{
        "AdGroupId",
        "Bid",
        "CampaignId",
        "LocalClicks",
        "LocalCost",
		   "LocalImpressions",
      },
      Predicates: []gads.Predicate{
        {"AdGroupId", "EQUALS", []string{adGroupId}},
      },
    },
  )

Selectable fields are

"AdGroupId", "Bid", "CampaignId", "EndDate", "LandscapeCurrent", "LandscapeType", "LocalClicks",
"LocalCost", "LocalImpressions", "PromotedImpressions", "StartDate"

filterable fields are

"AdGroupId", "Bid", "CampaignId", "LandscapeCurrent", "LandscapeType", "LocalClicks",
"LocalCost", "LocalImpressions", "PromotedImpressions"

Relevant documentation

    https://developers.google.com/adwords/api/docs/reference/v201809/DataService#getadgroupbidlandscape
	   https://developers.google.com/adwords/api/docs/appendix/selectorfields#v201809-DataService

func (*DataService) GetCriterionBidLandscape

func (s *DataService) GetCriterionBidLandscape(selector Selector) (criterionBidLandscapes []CriterionBidLandscape, totalCount int64, err error)

GetCriterionBidLandscape returns an array of CriterionBidLandscape objects the selector.

Example

  criterionBidLandscape, totalCount, err := dataService.GetCriterionBidLandscape(
    gads.Selector{
      Fields: []string{
        "AdGroupId",
		   "CriterionId",
        "Bid",
        "CampaignId",
        "LocalClicks",
        "LocalCost",
		   "LocalImpressions",
      },
      Predicates: []gads.Predicate{
        {"CriterionId", "EQUALS", []string{criterionId}},
      },
    },
  )

Selectable fields are

"AdGroupId", "Bid", "CampaignId", "CriterionId", "EndDate", "LandscapeCurrent", "LandscapeType", "LocalClicks",
"LocalCost", "LocalImpressions", "PromotedImpressions", "StartDate"

filterable fields are

"AdGroupId", "Bid", "CampaignId", "CriterionId", "LandscapeCurrent", "LandscapeType", "LocalClicks",
"LocalCost", "LocalImpressions", "PromotedImpressions"

Relevant documentation

    https://developers.google.com/adwords/api/docs/reference/v201809/DataService#getcriterionbidlandscape
	   https://developers.google.com/adwords/api/docs/appendix/selectorfields#v201809-DataService

func (*DataService) QueryAdGroupBidLandscape

func (s *DataService) QueryAdGroupBidLandscape(query string) (adGroupBidLandscapes []AdGroupBidLandscape, totalCount int64, err error)

QueryAdGroupBidLandscape returns a slice of AdGroupBidLandscapes based on passed in AWQL query

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201809/DataService#queryadgroupbidlandscape

func (*DataService) QueryCriterionBidLandscape

func (s *DataService) QueryCriterionBidLandscape(query string) (criterionBidLandscapes []CriterionBidLandscape, totalCount int64, err error)

QueryCriterionBidLandscape returns a slice of CriterionBidLandscapes based on passed in AWQL query

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201809/DataService#querycriterionbidlandscape

type DateRange

type DateRange struct {
	Min string `xml:"min"`
	Max string `xml:"max"`
}

Selector structs

type DateRuleItem

type DateRuleItem struct {
	Key   string `xml:"key>name"`
	Op    string `xml:"op"` // "UNKNOWN", "EQUALS", "NOT_EQUAL", "BEFORE", "AFTER"
	Value string `xml:"string"`
}

Rule structs

type DayOfWeek

type DayOfWeek string

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.DayOfWeek Days of the week. MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY

type Dimensions

type Dimensions struct {
	Name   string `xml:"key"` // "FULL", "SHRUNKEN", "PREVIEW", "VIDEO_THUMBNAIL"
	Width  int64  `xml:"value>width"`
	Height int64  `xml:"value>height"`
}

type DisapprovalReason

type DisapprovalReason struct {
	ShortName string `xml:"https://adwords.google.com/api/adwords/cm/v201809 shortName,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.DisapprovalReason Container for information about why an AdWords entity was disapproved.

type DoubleAttribute

type DoubleAttribute struct {
	Value float64 `xml:"value"`
}

type DraftService

type DraftService struct {
	Auth
}

func NewDraftService

func NewDraftService(auth *Auth) *DraftService

type DynamicSearchAd

type DynamicSearchAd struct {
	AdGroupId           int64             `xml:"-"`
	Id                  int64             `xml:"id,omitempty"`
	Url                 string            `xml:"url"`
	DisplayUrl          string            `xml:"displayUrl"`
	FinalUrls           []string          `xml:"finalUrls,omitempty"`
	FinalMobileUrls     []string          `xml:"finalMobileUrls,omitempty"`
	FinalAppUrls        []AppUrl          `xml:"finalAppUrls,omitempty"`
	TrackingUrlTemplate string            `xml:"trackingUrlTemplate,omitempty"`
	UrlCustomParameters *CustomParameters `xml:"urlCustomParameters,omitempty"`
	Type                string            `xml:"type,omitempty"`
	DevicePreference    int64             `xml:"devicePreference,omitempty"`
	Status              string            `xml:"-"`
}

type EntityError

type EntityError struct {
	FieldPath   string `xml:"fieldPath"`
	Trigger     string `xml:"trigger"`
	ErrorString string `xml:"errorString"`
	Reason      string `xml:"reason"`
}

type EnumValuePair

type EnumValuePair struct {
	EnumValue        string `xml:"enumValue"`
	EnumDisplayValue string `xml:"enumDisplayvalue"`
}

type Error

type Error interface {
	// Satisfy the generic error interface.
	error

	// Returns the short phrase depicting the classification of the error.
	Code() string

	// Returns the original error if one was set.  Nil is returned if not set.
	OrigErr() error
}

type ErrorsType

type ErrorsType struct {
	ApiExceptionFaults []ApiExceptionFault `xml:"ApiExceptionFault"`
}

func (ErrorsType) Error

func (f ErrorsType) Error() string

type ExpandedTextAd

type ExpandedTextAd struct {
	AdGroupId           int64                  `xml:"-"`
	Id                  int64                  `xml:"id,omitempty"`
	FinalUrls           []string               `xml:"finalUrls,omitempty"`
	FinalMobileUrls     []string               `xml:"finalMobileUrls,omitempty"`
	TrackingUrlTemplate string                 `xml:"trackingUrlTemplate,omitempty"`
	UrlCustomParameters *CustomParameters      `xml:"urlCustomParameters,omitempty"`
	Type                string                 `xml:"type,omitempty"`
	HeadlinePart1       string                 `xml:"headlinePart1,omitempty"`
	HeadlinePart2       string                 `xml:"headlinePart2,omitempty"`
	HeadlinePart3       string                 `xml:"headlinePart3,omitempty"`
	Description         string                 `xml:"description,omitempty"`
	Description2        string                 `xml:"description2,omitempty"`
	Path1               string                 `xml:"path1,omitempty"`
	Path2               string                 `xml:"path2,omitempty"`
	ExperimentData      *AdGroupExperimentData `xml:"-"`
	Status              string                 `xml:"-"`
	Labels              []Label                `xml:"-"`
	BaseCampaignId      *int64                 `xml:"-"`
	BaseAdGroupId       *int64                 `xml:"-"`
}

type Extension

type Extension interface{}

type ExtensionFeedItem

type ExtensionFeedItem struct {
	XMLName xml.Name `json:"-" xml:"extensions"`

	FeedId                  int64                      `xml:"https://adwords.google.com/api/adwords/cm/v201809 feedId,omitempty"`
	FeedItemId              int64                      `xml:"https://adwords.google.com/api/adwords/cm/v201809 feedItemId,omitempty"`
	Status                  *FeedItemStatus            `xml:"https://adwords.google.com/api/adwords/cm/v201809 status,omitempty"`
	FeedType                *FeedType                  `xml:"https://adwords.google.com/api/adwords/cm/v201809 feedType,omitempty"`
	StartTime               string                     `xml:"https://adwords.google.com/api/adwords/cm/v201809 startTime,omitempty"` //  special value "00000101 000000" may be used to clear an existing start time.
	EndTime                 string                     `xml:"https://adwords.google.com/api/adwords/cm/v201809 endTime,omitempty"`   //  special value "00000101 000000" may be used to clear an existing end time.
	DevicePreference        *FeedItemDevicePreference  `xml:"https://adwords.google.com/api/adwords/cm/v201809 devicePreference,omitempty"`
	Scheduling              *FeedItemScheduling        `xml:"https://adwords.google.com/api/adwords/cm/v201809 scheduling,omitempty"`
	CampaignTargeting       *FeedItemCampaignTargeting `xml:"https://adwords.google.com/api/adwords/cm/v201809 campaignTargeting,omitempty"`
	AdGroupTargeting        *FeedItemAdGroupTargeting  `xml:"https://adwords.google.com/api/adwords/cm/v201809 adGroupTargeting,omitempty"`
	KeywordTargeting        *Keyword                   `xml:"https://adwords.google.com/api/adwords/cm/v201809 keywordTargeting,omitempty"`
	GeoTargeting            *Location                  `xml:"https://adwords.google.com/api/adwords/cm/v201809 geoTargeting,omitempty"`
	GeoTargetingRestriction *FeedItemGeoRestriction    `xml:"https://adwords.google.com/api/adwords/cm/v201809 geoTargetingRestriction,omitempty"`
	PolicyData              *[]FeedItemPolicyData      `xml:"https://adwords.google.com/api/adwords/cm/v201809 policyData,omitempty"`

	ExtensionFeedItemType string `xml:"https://adwords.google.com/api/adwords/cm/v201809 ExtensionFeedItem.Type,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.ExtensionFeedItem Contains base extension feed item data for an extension in an extension feed managed by AdWords.

type ExtensionSetting

type ExtensionSetting struct {
	PlatformRestrictions ExtensionSettingPlatform `xml:"platformRestrictions,omitempty"`

	Extensions Extension `xml:"https://adwords.google.com/api/adwords/cm/v201809 extensions,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.ExtensionSetting A setting specifying when and which extensions should serve at a given level (customer, campaign, or ad group).

func (ExtensionSetting) MarshalXML

func (s ExtensionSetting) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*ExtensionSetting) UnmarshalXML

func (s *ExtensionSetting) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) (err error)

type ExtensionSettingPlatform

type ExtensionSettingPlatform string

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.ExtensionSetting.Platform Different levels of platform restrictions DESKTOP, MOBILE, NONE

type Fault

type Fault struct {
	XMLName     xml.Name   `xml:"Fault"`
	FaultCode   string     `xml:"faultcode"`
	FaultString string     `xml:"faultstring"`
	Errors      ErrorsType `xml:"detail"`
}

func (Fault) Error

func (f Fault) Error() string

type Feed

type Feed struct {
	Id                       int64                      `xml:"https://adwords.google.com/api/adwords/cm/v201809 id,omitempty"`
	Name                     string                     `xml:"https://adwords.google.com/api/adwords/cm/v201809 name,omitempty"`
	Attributes               []FeedAttribute            `xml:"https://adwords.google.com/api/adwords/cm/v201809 attributes,omitempty"`
	Status                   FeedStatus                 `xml:"https://adwords.google.com/api/adwords/cm/v201809 status,omitempty"`
	Origin                   FeedOrigin                 `xml:"https://adwords.google.com/api/adwords/cm/v201809 origin,omitempty"`
	SystemFeedGenerationData []SystemFeedGenerationData `xml:"https://adwords.google.com/api/adwords/cm/v201809 systemFeedGenerationData,omitempty"`
}

A Feed identifies a source of data and its schema. The data for the Feed can either be user-entered via the FeedItemService or system-generated, in which case the data is provided automatically. https://developers.google.com/adwords/api/docs/reference/v201809/FeedService.Feed

type FeedAttribute

type FeedAttribute struct {
	Id          int64             `xml:"https://adwords.google.com/api/adwords/cm/v201809 id,omitempty"`
	Name        string            `xml:"https://adwords.google.com/api/adwords/cm/v201809 name,omitempty"`
	Type        FeedAttributeType `xml:"https://adwords.google.com/api/adwords/cm/v201809 type,omitempty"`
	IsPartOfKey bool              `xml:"https://adwords.google.com/api/adwords/cm/v201809 isPartOfKey,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/FeedService.FeedAttribute FeedAttributes define the types of data expected to be present in a Feed. A single FeedAttribute specifies the expected type of the FeedItemAttributes with the same FeedAttributeId. Optionally, a FeedAttribute can be marked as being part of a FeedItem's unique key.

type FeedItemAdGroupTargeting

type FeedItemAdGroupTargeting struct {
	TargetingAdGroupId int64 `xml:"https://adwords.google.com/api/adwords/cm/v201809 TargetingAdGroupId,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.FeedItemAdGroupTargeting Specifies the adgroup the request context must match in order for the feed item to be considered eligible for serving (aka the targeted adgroup). E.g., if the below adgroup targeting is set to adgroup = X, then the feed item can only serve under adgroup X.

type FeedItemAttributeError

type FeedItemAttributeError struct {
	FeedAttributeIds    []int64 `xml:"https://adwords.google.com/api/adwords/cm/v201809 feedAttributeIds,omitempty"`
	ValidationErrorCode int     `xml:"https://adwords.google.com/api/adwords/cm/v201809 validationErrorCode,omitempty"`
	ErrorInformation    string  `xml:"https://adwords.google.com/api/adwords/cm/v201809 errorInformation,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.FeedItemAttributeError Contains validation error details for a set of feed attributes

type FeedItemCampaignTargeting

type FeedItemCampaignTargeting struct {
	TargetingCampaignId int64 `xml:"https://adwords.google.com/api/adwords/cm/v201809 TargetingCampaignId,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.FeedItemCampaignTargeting Specifies the campaign the request context must match in order for the feed item to be considered eligible for serving (aka the targeted campaign). E.g., if the below campaign targeting is set to campaignId = X, then the feed item can only serve under campaign X.

type FeedItemDevicePreference

type FeedItemDevicePreference struct {
	DevicePreference int64 `xml:"https://adwords.google.com/api/adwords/cm/v201809 devicePreference,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.FeedItemDevicePreference Represents a FeedItem device preference

type FeedItemGeoRestriction

type FeedItemGeoRestriction struct {
	GeoRestriction GeoRestriction `xml:"https://adwords.google.com/api/adwords/cm/v201809 geoRestriction,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.FeedItemGeoRestriction Represents a FeedItem geo restriction.

type FeedItemPolicyData

type FeedItemPolicyData struct {
	PolicyData
	PlaceholderType           int                               `xml:"https://adwords.google.com/api/adwords/cm/v201809 placeholderType,omitempty"`
	FeedMappingId             int64                             `xml:"https://adwords.google.com/api/adwords/cm/v201809 feedMappingId,omitempty"`
	ValidationStatus          FeedItemValidationStatus          `xml:"https://adwords.google.com/api/adwords/cm/v201809 validationStatus,omitempty"`
	ApprovalStatus            FeedItemApprovalStatus            `xml:"https://adwords.google.com/api/adwords/cm/v201809 approvalStatus,omitempty"`
	ValidationErrors          []FeedItemAttributeError          `xml:"https://adwords.google.com/api/adwords/cm/v201809 validationErrors,omitempty"`
	QualityApprovalStatus     FeedItemQualityApprovalStatus     `xml:"https://adwords.google.com/api/adwords/cm/v201809 qualityApprovalStatus,omitempty"`
	QualityDisapprovalReasons FeedItemQualityDisapprovalReasons `xml:"https://adwords.google.com/api/adwords/cm/v201809 qualityDisapprovalReasons,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.FeedItemPolicyData Contains offline-validation and approval results for a given FeedItem and FeedMapping. Each validation data indicates any issues found on the feed item when used in the context of the feed mapping.

type FeedItemQualityApprovalStatus

type FeedItemQualityApprovalStatus string

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.FeedItemQualityApprovalStatus Feed item quality evaluation approval status UNCHECKED, APPROVED, DISAPPROVED

type FeedItemSchedule

type FeedItemSchedule struct {
	DayOfWeek   DayOfWeek    `xml:"https://adwords.google.com/api/adwords/cm/v201809 dayOfWeek,omitempty"`
	StartHour   int          `xml:"https://adwords.google.com/api/adwords/cm/v201809 startHour,omitempty"`
	StartMinute MinuteOfHour `xml:"https://adwords.google.com/api/adwords/cm/v201809 startMinute,omitempty"`
	EndHour     int          `xml:"https://adwords.google.com/api/adwords/cm/v201809 endHour,omitempty"`
	EndMinute   MinuteOfHour `xml:"https://adwords.google.com/api/adwords/cm/v201809 endMinute,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.FeedItemSchedule Represents a FeedItem schedule, which specifies a time interval on a given day when the feed item may serve. The FeedItemSchedule times are in the account's time zone.

type FeedItemScheduling

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

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.FeedItemScheduling Represents a collection of FeedItem schedules specifying all time intervals for which the feed item may serve. Any time range not covered by the specified FeedItemSchedules will prevent the feed item from serving during those times.

type FeedItemService

type FeedItemService struct {
	Auth
}

func NewFeedItemService

func NewFeedItemService(auth *Auth) *FeedItemService

type FeedMappingService

type FeedMappingService struct {
	Auth
}

func NewFeedMappingService

func NewFeedMappingService(auth *Auth) *FeedMappingService

type FeedOrigin

type FeedOrigin string

Used to Specify who manages the FeedAttributes for the Feed. https://developers.google.com/adwords/api/docs/reference/v201809/FeedService.Feed.Origin USER, ADWORDS, UNKNOWN

type FeedService

type FeedService struct {
	Auth
}

func NewFeedService

func NewFeedService(auth *Auth) *FeedService

func (*FeedService) Query

func (s *FeedService) Query(query string) (page []Feed, totalCount int64, err error)

https://developers.google.com/adwords/api/docs/reference/v201809/FeedService

type FeedStatus

type FeedStatus string

https://developers.google.com/adwords/api/docs/reference/v201809/FeedService.Feed.Status Status of the Feed. ENABLED, REMOVED, UNKNOWN

type FeedType

type FeedType string

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.Feed.Type Feed hard type. Values coincide with placeholder type id. Enum: NONE, SITELINK, CALL, APP, REVIEW, AD_CUSTOMIZER, CALLOUT, STRUCTURED_SNIPPET, PRICE

type FrequencyCap

type FrequencyCap struct {
	Impressions int64  `xml:"impressions"`
	TimeUnit    string `xml:"timeUnit"`
	Level       string `xml:"level,omitempty"`
}

type FullSizeInfo

type FullSizeInfo struct {
	ImageHeight int64  `xml:"imageHeight,omitempty"`
	ImageWidth  int64  `xml:"imageWidth,omitempty"`
	ImageUrl    string `xml:"imageUrl,omitempty"`
}

type GAContext

type GAContext struct {
	ViewId     string
	StartDay   string
	EndDay     string
	Dimensions []string
	Metrics    []string
	Actid      string
}

type GAService

type GAService struct {
	Auth
}

A campaignService holds the connection information for the campaign service.

func NewGAService

func NewGAService(auth *Auth) *GAService

NewCampaignService creates a new campaignService

func (*GAService) Query

func (s *GAService) Query(ctx GAContext) ([]byte, error)

测试 //以mcc为粒度

type GenderCriterion

type GenderCriterion struct {
	Id         int64  `xml:"id,omitempty"`
	GenderType string `xml:"genderType"` // GenderType:  "GENDER_MALE", "GENDER_FEMALE", "GENDER_UNDETERMINED"
}

type GeoPoint

type GeoPoint struct {
	Latitude  int64 `xml:"latitudeInMicroDegrees"`
	Longitude int64 `xml:"longitudeInMicroDegrees"`
}

type GeoRestriction

type GeoRestriction string

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.GeoRestriction A restriction used to determine if the request context's geo should be matched. UNKNOWN, LOCATION_OF_PRESENCE

type HttpClient

type HttpClient interface {
	Do(*http.Request) (*http.Response, error)
}

type IdeaTextFilterSearchParameter

type IdeaTextFilterSearchParameter struct {
	Included []string `xml:"included"`
	Excluded []string `xml:"excluded"`
}

type IdeaTypeAttribute

type IdeaTypeAttribute struct {
	Value string `xml:"value"`
}

type ImageAd

type ImageAd struct {
	AdGroupId           int64             `xml:"-"`
	Id                  int64             `xml:"id,omitempty"`
	Url                 string            `xml:"url"`
	DisplayUrl          string            `xml:"displayUrl"`
	FinalUrls           []string          `xml:"finalUrls,omitempty"`
	FinalMobileUrls     []string          `xml:"finalMobileUrls,omitempty"`
	FinalAppUrls        []AppUrl          `xml:"finalAppUrls,omitempty"`
	TrackingUrlTemplate string            `xml:"trackingUrlTemplate,omitempty"`
	UrlCustomParameters *CustomParameters `xml:"urlCustomParameters,omitempty"`
	Type                string            `xml:"type,omitempty"`
	DevicePreference    int64             `xml:"devicePreference,omitempty"`
	Image               int64             `xml:"imageId"`
	Name                string            `xml:"name"`
	AdToCopyImageFrom   int64             `xml:"adToCopyImageFrom"`
	Status              string            `xml:"-"`
	Labels              []Label           `xml:"-"`
}

type ImageAsset

type ImageAsset struct {
	AssetId      string `xml:"assetId,omitempty"`
	AssetName    string `xml:"assetName,omitempty"`
	AssetSubtype string `xml:"assetSubtype,omitempty"`
}

type ImageUrl

type ImageUrl struct {
}

type IncludeAdultContentSearchParameter

type IncludeAdultContentSearchParameter struct{}

type IntegerSetAttribute

type IntegerSetAttribute struct {
	Value []int `xml:"value"`
}

type IpBlockCriterion

type IpBlockCriterion struct {
	Id int64 `xml:"id,omitempty"`
}

type Keyword

type Keyword struct {
	Id            int64         `xml:"https://adwords.google.com/api/adwords/cm/v201809 id,omitempty"`
	Type          CriterionType `xml:"https://adwords.google.com/api/adwords/cm/v201809 type,omitempty"`
	CriterionType CriterionType `xml:"https://adwords.google.com/api/adwords/cm/v201809 Criterion.Type,omitempty"`

	Text      string           `xml:"https://adwords.google.com/api/adwords/cm/v201809 text,omitempty"`
	MatchType KeywordMatchType `xml:"https://adwords.google.com/api/adwords/cm/v201809 matchType,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.Keyword Represents a keyword.

type KeywordCriterion

type KeywordCriterion struct {
	Id        int64  `xml:"https://adwords.google.com/api/adwords/cm/v201809 id,omitempty"`
	Text      string `xml:"https://adwords.google.com/api/adwords/cm/v201809 text,omitempty"`      // Text: up to 80 characters and ten words
	MatchType string `xml:"https://adwords.google.com/api/adwords/cm/v201809 matchType,omitempty"` // MatchType:  "EXACT", "PHRASE", "BROAD"
}

type KeywordEstimate

type KeywordEstimate struct {
	Min StatsEstimate `xml:"min"`
	Max StatsEstimate `xml:"max"`
}

type KeywordEstimateRequest

type KeywordEstimateRequest struct {
	Keyword KeywordCriterion `xml:"keyword"`
}

type KeywordMatchType

type KeywordMatchType string

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.KeywordMatchType Match type of a keyword. i.e. the way we match a keyword string with search queries. EXACT, PHRASE, BROAD

type Label

type Label struct {
	Type   string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id     int64  `xml:"id,omitempty"`
	Name   string `xml:"name,omitempty"`
	Status string `xml:"status,omitempty"`
}

Label represents a label.

func NewTextLabel

func NewTextLabel(name string) Label

NewTextLabel returns an new Label struct for creating a new TextLabel.

type LabelError

type LabelError struct {
	FieldPath   string `xml:"fieldPath"`
	Trigger     string `xml:"trigger"`
	ErrorString string `xml:"errorString"`
	Reason      string `xml:"reason"`
}

type LabelOperations

type LabelOperations map[string][]Label

LabelOperations is a map of operations to perform on Label's

type LabelService

type LabelService struct {
	Auth
}

func NewLabelService

func NewLabelService(auth *Auth) *LabelService

func (LabelService) Get

func (s LabelService) Get(selector Selector) (labels []Label, totalCount int64, err error)

Get returns an array of Label's and the total number of Label's matching the selector.

Example

labels, totalCount, err := labelService.Get(
  Selector{
    Fields: []string{"LabelId","LabelName","LabelStatus"},
    Predicates: []Predicate{
      {"LabelStatus", "EQUALS", []string{"ENABLED"}},
    },
  },
)

Selectable fields are

"LabelId", "LabelName", "LabelStatus"

filterable fields are

"LabelId", "LabelName", "LabelStatus"

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/LabelService#get

func (*LabelService) Mutate

func (s *LabelService) Mutate(labelOperations LabelOperations) (labels []Label, err error)

Mutate allows you to add, modify and remove labels, returning the modified labels.

Example

labels, err := labelService.Mutate(
  LabelOperations{
    "ADD": {
      NewTextLabel("Label1"),
      NewTextLabel("Label2"),
    },
    "SET": {
      modifiedLabel,
    },
    "REMOVE": {
      Label{Type:"TextLabel",Id:10},
    },
  },
)

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201409/LabelService#mutate

func (*LabelService) Query

func (s *LabelService) Query(query string) (labels []Label, totalCount int64, err error)

Query is not yet implemented

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201506/LabelService#query

type LandscapePoint

type LandscapePoint struct {
	Bid                 *int64 `xml:"bid>microAmount,omitempty"`
	Clicks              *int64 `xml:"clicks,omitempty"`
	Cost                *int64 `xml:"cost>microAmount,omitempty"`
	Impressions         *int64 `xml:"impressions,omitempty"`
	PromotedImpressions *int64 `xml:"promotedImpressions,omitempty"`
}

type LanguageCriterion

type LanguageCriterion struct {
	Id   int64  `xml:"https://adwords.google.com/api/adwords/cm/v201809 id,omitempty"`
	Code string `xml:"https://adwords.google.com/api/adwords/cm/v201809 code,omitempty"`
	Name string `xml:"https://adwords.google.com/api/adwords/cm/v201809 name,omitempty"`
}

type LanguageSearchParameter

type LanguageSearchParameter struct {
	Languages []LanguageCriterion `xml:"languages"`
}

type Location

type Location struct {
	Id            int64         `xml:"https://adwords.google.com/api/adwords/cm/v201809 id,omitempty"`
	Type          CriterionType `xml:"https://adwords.google.com/api/adwords/cm/v201809 type,omitempty"`
	CriterionType CriterionType `xml:"https://adwords.google.com/api/adwords/cm/v201809 Criterion.Type,omitempty"`

	LocationName    string                  `xml:"https://adwords.google.com/api/adwords/cm/v201809 locationName,omitempty"`
	DisplayType     string                  `xml:"https://adwords.google.com/api/adwords/cm/v201809 displayType,omitempty"`
	TargetingStatus LocationTargetingStatus `xml:"https://adwords.google.com/api/adwords/cm/v201809 targetingStatus,omitempty"`
	ParentLocations []Location              `xml:"https://adwords.google.com/api/adwords/cm/v201809 parentLocations,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.Location Represents Location criterion. A criterion of this type can only be created using an ID. LocationName: DisplayType: TargetingStatus: ACTIVE, OBSOLETE, PHASING_OUT ParentLocations:

type LocationCriterion

type LocationCriterion struct {
	Location      Location `xml:"location"`
	CanonicalName string   `xml:"canonicalName,omitempty"`
	Reach         string   `xml:"reach,omitempty"`
	Locale        string   `xml:"locale,omitempty"`
	SearchTerm    string   `xml:"searchTerm"`
}

type LocationCriterionService

type LocationCriterionService struct {
	Auth
}

func NewLocationCriterionService

func NewLocationCriterionService(auth *Auth) *LocationCriterionService

func (*LocationCriterionService) Get

func (s *LocationCriterionService) Get(selector Selector) (locationCriterions LocationCriterions, err error)

type LocationCriterions

type LocationCriterions []LocationCriterion

type LocationSearchParameter

type LocationSearchParameter struct {
	Locations []Location `xml:"locations"`
}

type LocationTargetingStatus

type LocationTargetingStatus string

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.LocationTargetingStatus Enum that represents the different Targeting Status values for a Location criterion. ACTIVE, OBSOLETE, PHASING_OUT

type LongAttribute

type LongAttribute struct {
	Value int64 `xml:"value"`
}

type ManagedCustomer

type ManagedCustomer struct {
	Name                  string         `xml:"name"`
	CustomerId            int64          `xml:"customerId,omitempty"`
	CanManageClients      bool           `xml:"canManageClients,omitempty"`
	CurrencyCode          string         `xml:"currencyCode"`
	DateTimeZone          string         `xml:"dateTimeZone"`
	TestAccount           bool           `xml:"testAccount,omitempty"`
	AccountLabels         []AccountLabel `xml:"accountLabels,omitempty"`
	ExcludeHiddenAccounts bool           `xml:"excludeHiddenAccounts,omitempty"`
}
type ManagedCustomerLink struct {
	ManagerCustomerId      int64  `xml:"managerCustomerId"`
	ClientCustomerId       int64  `xml:"clientCustomerId"`
	LinkStatus             string `xml:"linkStatus"`
	PendingDescriptiveName string `xml:"pendingDescriptiveName"`
	IsHidden               bool   `xml:isHidden"`
}

type ManagedCustomerOperations

type ManagedCustomerOperations map[string][]ManagedCustomer

type ManagedCustomerPage

type ManagedCustomerPage struct {
	Size                 int64                 `xml:"rval>totalNumEntries"`
	ManagedCustomers     []ManagedCustomer     `xml:"rval>entries"`
	ManagedCustomerLinks []ManagedCustomerLink `xml:"rval>links"`
}

type ManagedCustomerService

type ManagedCustomerService struct {
	Auth
}

func NewManagedCustomerService

func NewManagedCustomerService(auth *Auth) *ManagedCustomerService

func (*ManagedCustomerService) Get

func (s *ManagedCustomerService) Get(selector Selector) (managedCustomerPage ManagedCustomerPage, totalCount int64, err error)

func (*ManagedCustomerService) Mutate

func (s *ManagedCustomerService) Mutate(managedCustomerOperations ManagedCustomerOperations) (managedCustomers []ManagedCustomer, err error)

type Media

type Media struct {
	Type         string       `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id           int64        `xml:"mediaId,omitempty"`
	MediaType    string       `xml:"type"` // "AUDIO", "DYNAMIC_IMAGE", "ICON", "IMAGE", "STANDARD_ICON", "VIDEO"
	ReferenceId  int64        `xml:"referenceId,omitempty"`
	Dimensions   []Dimensions `xml:"dimensions"`
	Urls         []ImageUrl   `xml:"urls"`
	MimeType     string       `xml:"mimeType,omitempty"` // "IMAGE_JPEG", "IMAGE_GIF", "IMAGE_PNG", "FLASH", "TEXT_HTML", "PDF", "MSWORD", "MSEXCEL", "RTF", "AUDIO_WAV", "AUDIO_MP3"
	SourceUrl    string       `xml:"sourceUrl,omitempty"`
	Name         string       `xml:"name"`
	FileSize     int64        `xml:"fileSize,omitempty"`   // File size in bytes
	CreationTime string       `xml:"createTime,omitempty"` // format is YYYY-MM-DD HH:MM:SS+TZ

	// Audio / Video
	DurationMillis   int64  `xml:"durationMillis,omitempty"`
	StreamingUrl     string `xml:"streamingUrl,omitempty"`
	ReadyToPlayOnWeb bool   `xml:"readyToPlayOnTheWeb,omitempty"`

	// Image
	Data string `xml:"data,omitempty"` // base64Binary encoded raw image data

	// Video
	IndustryStandardCommercialIdentifier string `xml:"industryStandardCommercialIdentifier,omitempty"`
	AdvertisingId                        string `xml:"advertisingId,omitempty"`
	YouTubeVideoIdString                 string `xml:"youTubeVideoIdString,omitempty"`
}

Media represents an audio, image or video file.

func NewAudio

func NewAudio(name, mediaType, mimeType string) (image Media)

func NewImage

func NewImage(name, mediaType, mimeType string, data []byte) (image Media)

func NewVideo

func NewVideo(mediaType string) (image Media)

type MediaService

type MediaService struct {
	Auth
}

func NewMediaService

func NewMediaService(auth *Auth) *MediaService

func (*MediaService) Get

func (s *MediaService) Get(selector Selector) (medias []Media, totalCount int64, err error)

func (*MediaService) Query

func (s *MediaService) Query(query string) (medias []Media, totalCount int64, err error)

func (*MediaService) Upload

func (s *MediaService) Upload(medias []Media) (uploadedMedias []Media, err error)

type MinuteOfHour

type MinuteOfHour string

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.MinuteOfHour Minutes in an hour. Currently only 0, 15, 30, and 45 are supported ZERO, FIFTEEN, THIRTY, FORTY_FIVE

type MobileAd

type MobileAd struct {
	AdGroupId           int64             `xml:"-"`
	Id                  int64             `xml:"id,omitempty"`
	Url                 string            `xml:"url"`
	DisplayUrl          string            `xml:"displayUrl"`
	FinalUrls           []string          `xml:"finalUrls,omitempty"`
	FinalMobileUrls     []string          `xml:"finalMobileUrls,omitempty"`
	FinalAppUrls        []AppUrl          `xml:"finalAppUrls,omitempty"`
	TrackingUrlTemplate string            `xml:"trackingUrlTemplate,omitempty"`
	UrlCustomParameters *CustomParameters `xml:"urlCustomParameters,omitempty"`
	Type                string            `xml:"type,omitempty"`
	DevicePreference    int64             `xml:"devicePreference,omitempty"`
	Headline            string            `xml:"headline"`
	Description         string            `xml:"description"`
	MarkupLanguages     []string          `xml:"markupLanguages"`
	MobileCarriers      []string          `xml:"mobileCarriers"`
	BusinessName        string            `xml:"businessName"`
	CountryCode         string            `xml:"countryCode"`
	PhoneNumber         string            `xml:"phoneNumber"`
	Status              string            `xml:"-"`
	Labels              []Label           `xml:"-"`
}

type MobileAppCategoryCriterion

type MobileAppCategoryCriterion struct {
	Id                  int64  `xml:"id,omitempty"`
	MobileAppCategoryId int64  `xml:"mobileAppCategoryId"`
	DisplayName         string `xml:"displayName,omitempty"`
}

MobileAppCategoryId:

https://developers.google.com/adwords/api/docs/appendix/mobileappcategories

DisplayName:

type MobileApplicationCriterion

type MobileApplicationCriterion struct {
	Id          int64  `xml:"id,omitempty"`
	AppId       string `xml:"appId"`
	DisplayName string `xml:"displayName,omitempty"`
}

AppId: "{platform}-{platform_native_id}" DisplayName:

type MobileDeviceCriterion

type MobileDeviceCriterion struct {
	Id                  int64  `xml:"id,omitempty"`
	DeviceName          string `xml:"deviceName,omitempty"`
	ManufacturerName    string `xml:"manufacturerName,omitempty"`
	DeviceType          string `xml:"deviceType,omitempty"`
	OperatingSystemName string `xml:"operatingSystemName,omitempty"`
}

DeviceName: ManufacturerName: DeviceType: DEVICE_TYPE_MOBILE, DEVICE_TYPE_TABLET OperatingSystemName:

type MoneyAttribute

type MoneyAttribute struct {
	Value int64 `xml:"value>microAmount"`
}

type MonthlySearchVolume

type MonthlySearchVolume struct {
	Year  int   `xml:"year"`
	Month int   `xml:"month"`
	Count int64 `xml:"count"`
}

type MonthlySearchVolumeAttribute

type MonthlySearchVolumeAttribute struct {
	Value []MonthlySearchVolume `xml:"value"`
}

type MutateErrors

type MutateErrors struct {
	Errors EntityError `xml:"errors"`
}

type MutateMembersOperand

type MutateMembersOperand struct {
	UserListId int64    `xml:"userListId"`
	DataType   string   `xml:"dataType"`
	RemoveAll  *bool    `xml:"removeAll"`
	Members    []string `xml:"members"`
}

func NewMutateMembersOperand

func NewMutateMembersOperand() *MutateMembersOperand

func (MutateMembersOperand) MarshalXML

func (mmo MutateMembersOperand) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type MutateMembersOperations

type MutateMembersOperations struct {
	XMLName    xml.Name
	Operations []Operation `xml:"operations"`
}

type MutateResult

type MutateResult interface{}

type MutateResults

type MutateResults struct {
	Result    MutateResult   `xml:"result"`
	ErrorList []MutateErrors `xml:"errorList"`
	Index     int            `xml:"index"`
}

func (*MutateResults) UnmarshalXML

func (mr *MutateResults) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) (err error)

type NegativeAdGroupCriterion

type NegativeAdGroupCriterion struct {
	AdGroupId    int64     `xml:"adGroupId"`
	CriterionUse string    `xml:"criterionUse,omitempty"`
	Criterion    Criterion `xml:"criterion"`
}

func (NegativeAdGroupCriterion) MarshalXML

func (nagc NegativeAdGroupCriterion) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*NegativeAdGroupCriterion) UnmarshalXML

func (nagc *NegativeAdGroupCriterion) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

type NegativeCampaignCriterion

type NegativeCampaignCriterion struct {
	CampaignId  int64     `xml:"campaignId"`
	IsNegative  bool      `xml:"isNegative,omitempty"`
	Criterion   Criterion `xml:"criterion"`
	BidModifier *float64  `xml:"bidModifier,omitempty"`
	Errors      []error   `xml:"-"`
}

func (NegativeCampaignCriterion) MarshalXML

func (ncc NegativeCampaignCriterion) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type NetworkSearchParameter

type NetworkSearchParameter struct {
	NetworkSetting NetworkSetting `xml:"networkSetting"`
}

type NetworkSetting

type NetworkSetting struct {
	TargetGoogleSearch         bool `xml:"https://adwords.google.com/api/adwords/cm/v201809 targetGoogleSearch"`
	TargetSearchNetwork        bool `xml:"https://adwords.google.com/api/adwords/cm/v201809 targetSearchNetwork"`
	TargetContentNetwork       bool `xml:"https://adwords.google.com/api/adwords/cm/v201809 targetContentNetwork"`
	TargetPartnerSearchNetwork bool `xml:"https://adwords.google.com/api/adwords/cm/v201809 targetPartnerSearchNetwork"`
}

type NotEmptyError

type NotEmptyError struct {
	FieldPath   string `xml:"fieldPath"`
	Trigger     string `xml:"trigger"`
	ErrorString string `xml:"errorString"`
	Reason      string `xml:"reason"`
}

type NumberRuleItem

type NumberRuleItem struct {
	Key   string `xml:"key>name"`
	Op    string `xml:"op"` // "UNKNOWN", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "EQUALS", "NOT_EQUAL", "LESS_THAN", "LESS_THAN_OR_EQUAL"
	Value int64  `xml:"value"`
}

type OAuthConfigArgs

type OAuthConfigArgs struct {
	ClientID     string
	ClientSecret string
}

type OAuthTokenArgs

type OAuthTokenArgs struct {
	AccessToken  string
	RefreshToken string
}

type OfflineConversionService

type OfflineConversionService struct {
	Auth
}

func NewOfflineConversionService

func NewOfflineConversionService(auth *Auth) *OfflineConversionService

type OperatingSystemVersionCriterion

type OperatingSystemVersionCriterion struct {
	Id             int64  `xml:"id,omitempty"`
	Name           string `xml:"name,omitempty"`
	OsMajorVersion int64  `xml:"osMajorVersion,omitempty"`
	OsMinorVersion int64  `xml:"osMinorVersion,omitempty"`
	OperatorType   string `xml:"operatorType,omitempty"`
}

Name: OsMajorVersion: OsMinorVersion: OperatorType: GREATER_THAN_EQUAL_TO, EQUAL_TO, UNKNOWN

type Operation

type Operation struct {
	Operator string      `xml:"https://adwords.google.com/api/adwords/cm/v201809 operator"`
	Operand  interface{} `xml:"operand"`
	Xsi_type string      `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr,omitempty"`
}

type OperationError

type OperationError struct {
	Code      int64  `xml:"OperationError>Code"`
	Details   string `xml:"OperationError>Details"`
	ErrorCode string `xml:"OperationError>ErrorCode"`
	Message   string `xml:"OperationError>Message"`
}

type OptAd

type OptAd struct {
	AdGroupId int64  `xml:"adGroupId,omitempty"`
	Id        int64  `xml:"ad>id,omitempty"`
	Status    string `xml:"status"`
}

OptAd 用来开关ad

type OrderBy

type OrderBy struct {
	Field     string `xml:"field"`
	SortOrder string `xml:"sortOrder"`
}

type OtherCriterion

type OtherCriterion struct{}

type Page

type Page struct {
	TotalNumEntries int    `xml:"https://adwords.google.com/api/adwords/cm/v201809 totalNumEntries,omitempty"`
	PageType        string `xml:"https://adwords.google.com/api/adwords/cm/v201809 Page.Type,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.Page Contains the results from a get call.

type Paging

type Paging struct {
	Offset int64 `xml:"https://adwords.google.com/api/adwords/cm/v201809 startIndex"`
	Limit  int64 `xml:"https://adwords.google.com/api/adwords/cm/v201809 numberResults"`
}

type PlacementCriterion

type PlacementCriterion struct {
	Id  int64  `xml:"id,omitempty"`
	Url string `xml:"url"`
}

Url:

type PlatformCriterion

type PlatformCriterion struct {
	Id           int64  `xml:"id,omitempty"`
	PlatformName string `xml:"platformName,omitempty"`
}

PlatformId:

Desktop	30000
HighEndMobile	30001
Tablet	30002

type PolicyData

type PolicyData struct {
	DisapprovalReasons []DisapprovalReason `xml:"https://adwords.google.com/api/adwords/cm/v201809 disapprovalReasons,omitempty"`
	PolicyDataType     string              `xml:"https://adwords.google.com/api/adwords/cm/v201809 PolicyData.Type,omitempty"`
}

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupExtensionSettingService.PolicyData Approval and policy information attached to an entity.

type Predicate

type Predicate struct {
	Field    string   `xml:"field"`
	Operator string   `xml:"operator"`
	Values   []string `xml:"values"`
}

type ProductAd

type ProductAd struct {
	AdGroupId int64  `xml:"-"`
	Id        int64  `xml:"id,omitempty"`
	Type      string `xml:"type,omitempty"`
	Status    string `xml:"-"`
}

type ProductBiddingCategory

type ProductBiddingCategory ProductDimension

Represents a google_product_category level

type ProductBiddingCategoryData

type ProductBiddingCategoryData struct {
	DimensionValue       ProductBiddingCategory `xml:"dimensionValue"`
	ParentDimensionValue ProductBiddingCategory `xml:"parentDimensionValue"`
	Country              string                 `xml:"country"`
	Status               string                 `xml:"status"`
	DisplayValue         []StringMapEntry       `xml:"displayValue"`
}

type ProductCondition

type ProductCondition struct {
	Argument string `xml:"argument"`
	Operand  string `xml:"operand"`
}

Argument: Operand: id, product_type, brand, adwords_grouping, condition, adwords_labels

type ProductCriterion

type ProductCriterion struct {
	Id         int64              `xml:"id,omitempty"`
	Conditions []ProductCondition `xml:"conditions"`
	Text       string             `xml:"text,omitempty"`
}

type ProductDimension

type ProductDimension struct {
	Type          string `xml:"ProductDimension.Type"`
	DimensionType string `xml:"type,omitempty"`
	Value         string `xml:"value"`
}

func (ProductDimension) MarshalXML

func (s ProductDimension) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*ProductDimension) UnmarshalXML

func (s *ProductDimension) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

type ProductPartition

type ProductPartition struct {
	Id                int64            `xml:"id,omitempty"`
	CriteriaType      string           `xml:"type"`
	PartitionType     string           `xml:"partitionType,omitempty"`
	ParentCriterionId int64            `xml:"parentCriterionId,omitempty"`
	Dimension         ProductDimension `xml:"caseValue"`
	Cpc               *Cpc             // This value is inherited from BiddableAdgroupCriterion
}

func (ProductPartition) MarshalXML

func (s ProductPartition) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type ProductScope

type ProductScope struct {
	Id           int64              `xml:"id,omitempty"`
	CriteriaType string             `xml:"type"`
	Dimensions   []ProductDimension `xml:"dimensions"`
}

type ProgressStats

type ProgressStats struct {
	NumOperationsExecuted    int64 `xml:"numOperationsExecuted" json:",string"`
	NumOperationsSucceeded   int64 `xml:"numOperationsSucceeded" json:",string"`
	EstimatedPercentExecuted int   `xml:"estimatedPercentExecuted"`
	NumResultsWritten        int64 `xml:"numResultsWritten" json:",string"`
}

type ProximityCriterion

type ProximityCriterion struct {
	Id                  int64    `xml:"id,omitempty"`
	GeoPoint            GeoPoint `xml:"geoPoint"`
	RadiusDistanceUnits string   `xml:"radiusDistanceUnits"`
	RadiusInUnits       float64  `xml:"radiusInUnits"`
	Address             Address  `xml:"address"`
}

RadiusDistanceUnits: KILOMETERS, MILES RadiusUnits:

type QualityInfo

type QualityInfo struct {
	QualityScore int64 `xml:"qualityScore,omitempty"`
}

type RateExceededError

type RateExceededError struct {
	RateName          string `xml:"rateName"`  // For example OperationsByMinute
	RateScope         string `xml:"rateScope"` // ACCOUNT or DEVELOPER
	ErrorString       string `xml:"errorString"`
	Reason            string `xml:"reason"`
	RetryAfterSeconds uint   `xml:"retryAfterSeconds"` // Try again in...
}

if you exceed the quota given by google

type RelatedToQuerySearchParameter

type RelatedToQuerySearchParameter struct {
	Queries []string `xml:"queries"`
}

type RelatedToUrlSearchParameter

type RelatedToUrlSearchParameter struct {
	Urls           []string `xml:"urls"`
	IncludeSubUrls bool     `xml:"includeSubUrls"`
}

type RemarketingSettings

type RemarketingSettings struct {
	Snippet string `xml:"snippet"`
}

type ReportDefinition

type ReportDefinition struct {
	Selector       Selector `xml:"selector"`
	ReportName     string   `xml:"reportName"`
	ReportType     string   `xml:"reportType"`
	DateRangeType  string   `xml:"dateRangeType"`
	DownloadFormat string   `xml:"downloadFormat"`
}

type ReportDefinitionField

type ReportDefinitionField struct {
	FieldName           string          `xml:"fieldName"`
	DisplayFieldName    string          `xml:"displayFieldName"`
	XmlAttributeName    string          `xml:"xmlAttributeName"`
	FieldType           string          `xml:"fieldType"`
	FieldBehavior       string          `xml:"fieldBehavior"`
	EnumValues          []string        `xml:"enumValues"`
	CanSelect           bool            `xml:"canSelect"`
	CanFilter           bool            `xml:"canFilter"`
	IsEnumType          bool            `xml:"isEnumType"`
	IsBeta              bool            `xml:"isBeta"`
	IsZeroRowCompatible bool            `xml:"isZeroRowCompatible"`
	EnumValuePairs      []EnumValuePair `xml:"enumValuePairs"`
}

type ReportDefinitionRequest

type ReportDefinitionRequest struct {
	ReportType string `xml:"reportType"`
}

type ReportDefinitionService

type ReportDefinitionService struct {
	Auth
}

func NewReportDefinitionService

func NewReportDefinitionService(auth *Auth) *ReportDefinitionService

func (*ReportDefinitionService) GetReportFields

func (s *ReportDefinitionService) GetReportFields(report string) (fields []ReportDefinitionField, err error)

type ReportDownloadError

type ReportDownloadError struct {
	XMLName  xml.Name `xml:"reportDownloadError"`
	ApiError ApiError
}

type ReportDownloadService

type ReportDownloadService struct {
	Auth
}

func NewReportDownloadService

func NewReportDownloadService(auth *Auth) *ReportDownloadService

func (*ReportDownloadService) AWQL

func (s *ReportDownloadService) AWQL(awql string, fmt string) (interface{}, error)

func (*ReportDownloadService) Get

func (s *ReportDownloadService) Get(reportDefinition ReportDefinition) (res interface{}, err error)

func (*ReportDownloadService) StreamAWQL

func (s *ReportDownloadService) StreamAWQL(awql string, fmt string) (io.ReadCloser, error)

type ResponsiveDisplayAd

type ResponsiveDisplayAd struct {
	AdGroupId           int64                 `xml:"-"`
	Id                  int64                 `xml:"id,omitempty"`
	FinalUrls           []string              `xml:"finalUrls,omitempty"`
	FinalMobileUrls     []string              `xml:"finalMobileUrls,omitempty"`
	TrackingUrlTemplate string                `xml:"trackingUrlTemplate,omitempty"`
	UrlCustomParameters *CustomParameters     `xml:"urlCustomParameters,omitempty"`
	Type                string                `xml:"type,omitempty"`
	MarketingImage      Media                 `xml:"marketingImage"`
	LogoImage           Media                 `xml:"logoImage"`
	ShortHeadline       string                `xml:"shortHeadline"`
	LongHeadline        string                `xml:"longHeadline"`
	Description         string                `xml:"description"`
	BusinessName        string                `xml:"businessName"`
	ExperimentData      AdGroupExperimentData `xml:"-"`
	Status              string                `xml:"-"`
	Labels              []Label               `xml:"-"`
	BaseCampaignId      int64                 `xml:"-"`
	BaseAdGroupId       int64                 `xml:"-"`
}

type ResponsiveSearchAd

type ResponsiveSearchAd struct {
	AdGroupId int64 `xml:"-"`
	//Type                string            `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id                  int64             `xml:"id,omitempty"`
	Url                 string            `xml:"url,omitempty"`
	DisplayUrl          string            `xml:"displayUrl,omitempty"`
	FinalUrls           []string          `xml:"finalUrls,omitempty"`
	FinalMobileUrls     []string          `xml:"finalMobileUrls,omitempty"`
	FinalAppUrls        []AppUrl          `xml:"finalAppUrls,omitempty"`
	TrackingUrlTemplate string            `xml:"trackingUrlTemplate,omitempty"`
	FinalUrlSuffix      string            `xml:"finalUrlSuffix,omitempty"`
	UrlCustomParameters *CustomParameters `xml:"urlCustomParameters,omitempty"`
	DevicePreference    int64             `xml:"devicePreference,omitempty"`
	Headlines           []AssetLink       `xml:"headlines,omitempty"`
	Descriptions        []AssetLink       `xml:"descriptions,omitempty"`
	Labels              []Label           `xml:"-"`
	Status              string            `xml:"-"`
	Path1               string            `xml:"path1,omitempty"`
	Path2               string            `xml:"path2,omitempty"`
}

func NewResponsiveSearchAd

func NewResponsiveSearchAd(adGroupId int64, headlines, descriptions []AssetLink, finalUrls []string, path1, path2 string) ResponsiveSearchAd

type Rule

type Rule struct {
	Groups []RuleItemGroup `xml:"groups"`
}

type RuleItemGroup

type RuleItemGroup struct {
	Items []interface{} `xml:"items"`
}

type SearchParameter

type SearchParameter interface{}

type SearchVolumeSearchParameter

type SearchVolumeSearchParameter struct {
	Minimum int `xml:"operation>minimum"`
	Maximum int `xml:"operation>maximum"`
}

type SeedAdGroupIdSearchParameter

type SeedAdGroupIdSearchParameter struct {
	AdGroupID int64 `xml:"adGroupId"`
}

type Selector

type Selector struct {
	XMLName    xml.Name
	Fields     []string    `xml:"fields"`
	Predicates []Predicate `xml:"predicates"`
	DateRange  *DateRange  `xml:"dateRange,omitempty"`
	Ordering   []OrderBy   `xml:"ordering"`
	Paging     *Paging     `xml:"paging,omitempty"`
}
type ServiceLink struct {
	ServiceType   string `xml:"serviceType"`
	ServiceLinkId int64  `xml:"serviceLinkId"`
	LinkStatus    string `xml:"linkStatus"`
	Name          string `xml:"name"`
}

type ServiceUrl

type ServiceUrl struct {
	Url  string
	Name string
}

func (ServiceUrl) String

func (s ServiceUrl) String() string

type SharedCriterion

type SharedCriterion struct {
	SharedSetId int64     `xml:"sharedSetId,omitempty"`
	Negative    bool      `xml:"negative,omitempty"`
	Criterion   Criterion `xml:"criterion,omitempty"`
}

func (SharedCriterion) MarshalXML

func (s SharedCriterion) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*SharedCriterion) UnmarshalXML

func (s *SharedCriterion) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

type SharedCriterionOperation

type SharedCriterionOperation struct {
	Operator string          `xml:"operator,omitempty"`
	Operand  SharedCriterion `xml:"operand,omitempty"`
}

type SharedCriterionService

type SharedCriterionService struct {
	Auth
}

func NewSharedCriterionService

func NewSharedCriterionService(auth *Auth) *SharedCriterionService

func (SharedCriterionService) Get

func (s SharedCriterionService) Get(selector Selector) (sharedCriteria []SharedCriterion, totalCount int64, err error)

func (SharedCriterionService) Mutate

func (s SharedCriterionService) Mutate(operations []SharedCriterionOperation) error

type SharedSet

type SharedSet struct {
	Id             int64  `xml:"sharedSetId,omitempty"`
	Name           string `xml:"name,omitempty"`
	Type           string `xml:"type,omitempty"`
	MemberCount    int    `xml:"memberCount,omitempty"`
	ReferenceCount int    `xml:"referenceCount,omitempty"`
	Status         string `xml:"status,omitempty"`
}

type SharedSetOperation

type SharedSetOperation struct {
	Operator string    `xml:"operator,omitempty"`
	Operand  SharedSet `xml:"operand,omitempty"`
}

type SharedSetService

type SharedSetService struct {
	Auth
}

func NewSharedSetService

func NewSharedSetService(auth *Auth) *SharedSetService

func (SharedSetService) Get

func (s SharedSetService) Get(selector Selector) (sharedSets []SharedSet, totalCount int64, err error)

func (SharedSetService) Mutate

func (s SharedSetService) Mutate(operations []SharedSetOperation) ([]SharedSet, error)

type StatsEstimate

type StatsEstimate struct {
	AverageCpc        int64   `xml:"averageCpc>microAmount"`
	AveragePosition   float64 `xml:"averagePosition"`
	ClickThroughRate  float64 `xml:"clickThroughRate"`
	ClicksPerDay      float64 `xml:"clicksPerDay"`
	ImpressionsPerDay float64 `xml:"impressionsPerDay"`
	TotalCost         int64   `xml:"totalCost>microAmount"`
}

type StringAttribute

type StringAttribute struct {
	Value string `xml:"value"`
}

type StringMapEntry

type StringMapEntry struct {
	Key   string `xml:"key"`
	Value string `xml:"value"`
}

type StringRuleItem

type StringRuleItem struct {
	Key   string `xml:"key>name"`
	Op    string `xml:"op"` // "UNKNOWN", "CONTAINS", "EQUALS", "STARTS_WITH", "ENDS_WITH", "NOT_EQUAL", "NOT_CONTAIN", "NOT_START_WITH", "NOT_END_WITH"
	Value string `xml:"string"`
}

type SystemFeedGenerationData

type SystemFeedGenerationData struct {
	SystemFeedGenerationDataType string `xml:"https://adwords.google.com/api/adwords/cm/v201809 SystemFeedGenerationData.Type,omitempty"`
}

Configuration data allowing feed items to be populated for a system feed. https://developers.google.com/adwords/api/docs/reference/v201809/FeedService.SystemFeedGenerationData

type TargetCpa

type TargetCpa struct {
	Amount int64 `xml:"microAmount,omitempty"`
}

type TargetDetails

type TargetDetails struct {
	CriterionTypeGroup string `xml:"criterionTypeGroup,omitempty"`
	TargetAll          bool   `xml:"targetAll,omitempty"`
}

type TargetError

type TargetError struct {
	FieldPath   string `xml:"fieldPath"`
	Trigger     string `xml:"trigger"`
	ErrorString string `xml:"errorString"`
	Reason      string `xml:"reason"`
}

type TargetSettingDetail

type TargetSettingDetail struct {
	CriterionTypeGroup string `xml:"criterionTypeGroup"`
	TargetAll          bool   `xml:"targetAll"`
}

type TargetingIdea

type TargetingIdea struct {
	Key   string    `xml:"key"`
	Value Attribute `xml:"value"`
}

func (*TargetingIdea) UnmarshalXML

func (ti *TargetingIdea) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) (err error)

type TargetingIdeaSelector

type TargetingIdeaSelector struct {
	SearchParameters        []SearchParameter `xml:"searchParameters"`
	IdeaType                string            `xml:"ideaType"`
	RequestType             string            `xml:"requestType"`
	RequestedAttributeTypes []string          `xml:"requestedAttributeTypes"`
	Paging                  Paging            `xml:"paging"`
	LocaleCode              string            `xml:"localeCode,omitempty"`
	CurrencyCode            string            `xml:"currencyCode,omitempty"`
}

TargetingIdeaSelector A descriptor for finding TargetingIdeas that match the specified criteria. https://developers.google.com/adwords/api/docs/reference/v201809/TargetingIdeaService.TargetingIdeaSelector

func (TargetingIdeaSelector) MarshalXML

func (tis TargetingIdeaSelector) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type TargetingIdeaService

type TargetingIdeaService struct {
	Auth
}

TargetingIdeaService Use this service to generate new keyword ideas based on the parameters specified in the selector. See the TargetingIdeaSelector documentation for more details. You can also use this service to retrieve statistics for existing keyword ideas by setting the selector's requestType to RequestType.STATS and passing in the appropriate search parameters.

func NewTargetingIdeaService

func NewTargetingIdeaService(auth *Auth) *TargetingIdeaService

NewTargetingIdeaService returns a new TargetingIdeaService

func (*TargetingIdeaService) Get

func (s *TargetingIdeaService) Get(selector TargetingIdeaSelector) (targetingIdeas []TargetingIdeas, totalCount int64, err error)

Get Returns a page of ideas that match the query described by the specified TargetingIdeaSelector. https://developers.google.com/adwords/api/docs/reference/v201809/TargetingIdeaService

type TargetingIdeas

type TargetingIdeas struct {
	TargetingIdea []TargetingIdea `xml:"data"`
}

type TemplateAd

type TemplateAd struct {
	AdGroupId           int64             `xml:"-"`
	Id                  int64             `xml:"id,omitempty"`
	Url                 string            `xml:"url"`
	DisplayUrl          string            `xml:"displayUrl"`
	FinalUrls           []string          `xml:"finalUrls,omitempty"`
	FinalMobileUrls     []string          `xml:"finalMobileUrls,omitempty"`
	FinalAppUrls        []AppUrl          `xml:"finalAppUrls,omitempty"`
	TrackingUrlTemplate string            `xml:"trackingUrlTemplate,omitempty"`
	UrlCustomParameters *CustomParameters `xml:"urlCustomParameters,omitempty"`
	Type                string            `xml:"type,omitempty"`
	DevicePreference    int64             `xml:"devicePreference,omitempty"`
	TemplateId          int64             `xml:"templateId"`
	AdUnionId           int64             `xml:"adUnionId>id"`
	TemplateElements    []TemplateElement `xml:"templateElements"`
	Dimensions          []Dimensions      `xml:"dimensions"`
	Name                string            `xml:"name"`
	Duration            int64             `xml:"duration"`

	Status string  `xml:"-"`
	Labels []Label `xml:"-"`
	// contains filtered or unexported fields
}

type TemplateElement

type TemplateElement struct {
	UniqueName string                 `xml:"uniqueName"`
	Fields     []TemplateElementField `xml:"fields"`
}

type TemplateElementField

type TemplateElementField struct {
	Name       string `xml:"name"`
	Type       string `xml:"type"`
	FieldText  string `xml:"fieldText"`
	FieldMedia string `xml:"fieldMedia"`
}

type TemporaryUrl

type TemporaryUrl struct {
	Url        string `xml:"url"`
	Expiration string `xml:"expiration,"`
}

type TextAd

type TextAd struct {
	AdGroupId           int64             `xml:"-"`
	Id                  int64             `xml:"id,omitempty"`
	Url                 string            `xml:"url"`
	DisplayUrl          string            `xml:"displayUrl"`
	FinalUrls           []string          `xml:"finalUrls,omitempty"`
	FinalMobileUrls     []string          `xml:"finalMobileUrls,omitempty"`
	FinalAppUrls        []AppUrl          `xml:"finalAppUrls,omitempty"`
	TrackingUrlTemplate string            `xml:"trackingUrlTemplate,omitempty"`
	UrlCustomParameters *CustomParameters `xml:"urlCustomParameters,omitempty"`
	Type                string            `xml:"type,omitempty"`
	DevicePreference    int64             `xml:"devicePreference,omitempty"`
	Headline            string            `xml:"headline"`
	Description1        string            `xml:"description1"`
	Description2        string            `xml:"description2"`
	Status              string            `xml:"-"`
	Labels              []Label           `xml:"-"`
}

func NewTextAd

func NewTextAd(adGroupId int64, url, displayUrl, headline, description1, description2, status string) TextAd

type TextAsset

type TextAsset struct {
	AssetId      string `xml:"assetId,omitempty"`
	AssetName    string `xml:"assetName,omitempty"`
	AssetSubtype string `xml:"assetSubtype,omitempty"`
	AssetText    string `xml:"assetText,omitempty"`
}

type TrafficEstimatorSelector

type TrafficEstimatorSelector struct {
	CampaignEstimateRequests []CampaignEstimateRequest `xml:"campaignEstimateRequests"`
}

type TrafficEstimatorService

type TrafficEstimatorService struct {
	Auth
}

func NewTrafficEstimatorService

func NewTrafficEstimatorService(auth *Auth) *TrafficEstimatorService

func (*TrafficEstimatorService) Get

Get returns an array of CampaignEstimates, holding AdGroupEstimates which hold KeywordEstimates, which hold the minimum and maximum values based on the requested keywords.

Example

keywordEstimateRequests := []KeywordEstimateRequest{
	KeywordEstimateRequest{
		KeywordCriterion{
			Text:      "mars cruise",
			MatchType: "BROAD",
		},
	},
	KeywordEstimateRequest{
		KeywordCriterion{
			Text:      "cheap cruise",
			MatchType: "EXACT",
		},
	},
	KeywordEstimateRequest{
		KeywordCriterion{
			Text:      "cruise",
			MatchType: "EXACT",
		},
	},
}

adGroupEstimateRequests := []AdGroupEstimateRequest{
	AdGroupEstimateRequest{
		KeywordEstimateRequests: keywordEstimateRequests,
		MaxCpc:                  1000000,
	},
}

campaignEstimateRequests := []CampaignEstimateRequest{
	CampaignEstimateRequest{
		AdGroupEstimateRequests: adGroupEstimateRequests,
	},
}

estimates, err := trafficEstimatorService.Get(TrafficEstimatorSelector{
	CampaignEstimateRequests: campaignEstimateRequests,
})

if err != nil {
	panic(err)
}

for _, estimate := range estimates {
	for _, adGroupEstimate := range estimate.AdGroupEstimates {
		for _, keywordEstimate := range adGroupEstimate.KeywordEstimates {
			fmt.Printf("Avg cpc: %d", keywordEstimate.Min.AverageCpc)
		}
	}
}

Relevant documentation

https://developers.google.com/adwords/api/docs/reference/v201809/TrafficEstimatorService#get

type TrialService

type TrialService struct {
	Auth
}

func NewTrialService

func NewTrialService(auth *Auth) *TrialService

type UrlError

type UrlError struct {
	EntityError
}

type UserInterestCriterion

type UserInterestCriterion struct {
	Id   int64  `xml:"userInterestId,omitempty"`
	Name string `xml:"userInterestName"`
}

type UserList

type UserList struct {
	Id                    int64   `xml:"id,omitempty"`
	Readonly              *bool   `xml:"isReadOnly"`
	Name                  string  `xml:"name"`
	Description           string  `xml:"description"`
	Status                string  `xml:"status"` // membership status "OPEN", "CLOSED"
	IntegrationCode       string  `xml:"integrationCode"`
	AccessReason          string  `xml:"accessReason"`          // account access resson "OWNER", "SHARED", "LICENSED", "SUBSCRIBED"
	AccountUserListStatus string  `xml:"accountUserListStatus"` // if share is still active "ACTIVE", "INACTIVE"
	MembershipLifeSpan    int64   `xml:"membershipLifeSpan"`    // number of days cookie stays on list
	Size                  *int64  `xml:"size,omitempty"`
	SizeRange             *string `xml:"sizeRange,omitempty"`          // size range "LESS_THEN_FIVE_HUNDRED","LESS_THAN_ONE_THOUSAND", "ONE_THOUSAND_TO_TEN_THOUSAND","TEN_THOUSAND_TO_FIFTY_THOUSAND","FIFTY_THOUSAND_TO_ONE_HUNDRED_THOUSAND","ONE_HUNDRED_THOUSAND_TO_THREE_HUNDRED_THOUSAND","THREE_HUNDRED_THOUSAND_TO_FIVE_HUNDRED_THOUSAND","FIVE_HUNDRED_THOUSAND_TO_ONE_MILLION","ONE_MILLION_TO_TWO_MILLION","TWO_MILLION_TO_THREE_MILLION","THREE_MILLION_TO_FIVE_MILLION","FIVE_MILLION_TO_TEN_MILLION","TEN_MILLION_TO_TWENTY_MILLION","TWENTY_MILLION_TO_THIRTY_MILLION","THIRTY_MILLION_TO_FIFTY_MILLION","OVER_FIFTY_MILLION"
	SizeForSearch         *int64  `xml:"sizeForSearch,omitempty"`      // estimated number of google.com users in this group
	SizeRangeForSearch    *string `xml:"sizeRangeForSearch,omitempty"` // same values as size range but for search
	ListType              *string `xml:"sizeType,omitempty"`           // one of "UNKNOWN", "REMARKETING", "LOGICAL", "EXTERNAL_REMARKETING", "RULE_BASED", "SIMILAR"

	// LogicalUserList
	LogicalRules *[]UserListLogicalRule `xml:"rules,omitempty"`

	// BasicUserList
	ConversionTypes *[]UserListConversionType `xml:"conversionTypes"`

	// RuleUserList
	Rule      *Rule   `xml:"rule,omitempty"`
	StartDate *string `xml:"startDate,omitempty"`
	EndDate   *string `xml:"endDate,omitempty"`

	// SimilarUserList
	SeedUserListId          *int64  `xml:"seedUserListId,omitempty"`
	SeedUserListName        *string `xml:"seedUserListName,omitempty"`
	SeedUserListDescription *string `xml:"seedUserListDescription,omitempty"`
	SeedUserListStatus      *string `xml:"seedUserListStatus,omitempty"`
	SeedListSize            *int64  `xml:"seedListSize,omitempty"`

	// CrmBasedUserList
	OptOutLink *string `xml:"optOutLink,omitempty"`

	// Keep track of xsi:type for mutate and mutateMembers
	Xsi_type string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr,omitempty"`
}

func NewBasicUserList

func NewBasicUserList(name, description, status, integrationCode string, membershipLifeSpan int64, conversionTypes []UserListConversionType) (adwordsUserList UserList)

func NewCrmBasedUserList

func NewCrmBasedUserList(name, description string, membershipLifeSpan int64, optOutLink string) (adwordsUserList UserList)

func NewDateSpecificRuleUserList

func NewDateSpecificRuleUserList(name, description, status, integrationCode string, membershipLifeSpan int64, rule Rule, startDate, endDate string) (adwordsUserList UserList)

func NewExpressionRuleUserList

func NewExpressionRuleUserList(name, description, status, integrationCode string, membershipLifeSpan int64, rule Rule) (adwordsUserList UserList)

func NewLogicalUserList

func NewLogicalUserList(name, description, status, integrationCode string, membershipLifeSpan int64, logicalRules []UserListLogicalRule) (adwordsUserList UserList)

func NewSimilarUserList

func NewSimilarUserList(name, description, status, integrationCode string, membershipLifeSpan int64) (adwordsUserList UserList)

type UserListConversionType

type UserListConversionType struct {
	Id       *int64
	Name     string
	Category *string `xml:"category"` // "BOOMERANG_EVENT", "OTHER"
}

type UserListCriterion

type UserListCriterion struct {
	Id                       int64  `xml:"id,omitempty"`
	UserListId               int64  `xml:"userListId"`
	UserListName             string `xml:"userListName"`
	UserListMembershipStatus string `xml:"userListMembershipStatus"`
}

type UserListLogicalRule

type UserListLogicalRule struct {
	Operator     string     `xml:"operator"` // "ALL", "ANY", "NONE", "UNKNOWN"
	RuleOperands []UserList `xml:"ruleOperands"`
}

type UserListOperations

type UserListOperations struct {
	XMLName    xml.Name
	Operations []Operation `xml:"operations"`
}

type VerticalCriterion

type VerticalCriterion struct {
	Id       int64    `xml:"verticalId,omitempty"`
	ParentId int64    `xml:"verticalParentId"`
	Path     []string `xml:"path"`
}

type VideoAsset

type VideoAsset struct {
	AssetId        string `xml:"assetId,omitempty"`
	AssetName      string `xml:"assetName,omitempty"`
	AssetSubtype   string `xml:"assetSubtype,omitempty"`
	YouTubeVideoId string `xml:"youTubeVideoId,omitempty"`
}

type WebpageCondition

type WebpageCondition struct {
	Operand  string `xml:"operand"`
	Argument string `xml:"argument"`
}

type WebpageCriterion

type WebpageCriterion struct {
	Id               int64            `xml:"id,omitempty"`
	Parameter        WebpageParameter `xml:"parameter"`
	CriteriaCoverage float64          `xml:"criteriaCoverage"`
	CriteriaSamples  []string         `xml:"criteriaSamples"`
}

type WebpageDescriptor

type WebpageDescriptor struct {
	Url   string `xml:"url"`
	Title string `xml:"title"`
}

type WebpageDescriptorAttribute

type WebpageDescriptorAttribute struct {
	Value WebpageDescriptor `xml:"value"`
}

type WebpageParameter

type WebpageParameter struct {
	CriterionName string             `xml:"criterionName"`
	Conditions    []WebpageCondition `xml:"conditions"`
}

Directories

Path Synopsis
setup_oauth2 is a tool for creating a gads configuration file config.json from the installed application credential stored in credentials.json.
setup_oauth2 is a tool for creating a gads configuration file config.json from the installed application credential stored in credentials.json.

Jump to

Keyboard shortcuts

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