Module Adwords_helpers


module Adwords_helpers: sig .. end
Helper functions for iterating over accounts and copying.

Previously these were part of the Adwords module.

$Id: adwords_helpers.mli,v 1.1 2006/08/12 16:20:11 rich Exp $


val iter_campaigns : Adwords.services -> (CampaignService_types.campaign -> unit) -> unit
iter_campaigns svcs f calls f campaign for each campaign. Exceptions are printed and ignored. Not thread safe.
val filter_iter_campaigns : Adwords.services ->
(CampaignService_types.campaign -> bool) ->
(CampaignService_types.campaign -> unit) -> unit
filter_iter_campaigns svcs test1 f calls f campaign for each campaign which matches test1 campaign. Exceptions are printed and ignored. Not thread safe.
val iter_adgroups : Adwords.services ->
(CampaignService_types.campaign -> AdGroupService_types.adGroup -> unit) ->
unit
iter_adgroups svcs f calls f campaign adgroup for each adgroup. Not thread safe.
val filter_iter_adgroups : Adwords.services ->
(CampaignService_types.campaign -> bool) ->
(CampaignService_types.campaign -> AdGroupService_types.adGroup -> bool) ->
(CampaignService_types.campaign -> AdGroupService_types.adGroup -> unit) ->
unit
filter_iter_adgroups svcs test1 test2 f calls f campaign adgroup for each adgroup which matches test1 campaign and test2 campaign adgroup. Exceptions are printed and ignored. Not thread safe.
val iter_criteria : Adwords.services ->
(CampaignService_types.campaign ->
AdGroupService_types.adGroup -> CriterionService_types.criterion -> unit) ->
unit
iter_criteria svcs f calls f campaign adgroup criterion for each criterion. Exceptions are printed and ignored. Not thread safe.
val iter_criteria2 : Adwords.services ->
(CampaignService_types.campaign ->
AdGroupService_types.adGroup ->
CriterionService_types.criterion list -> unit) ->
unit
iter_criteria2 svcs f calls f campaign adgroup criteria once for each adgroup. Exceptions are printed and ignored. Not thread safe.
val filter_iter_criteria : Adwords.services ->
(CampaignService_types.campaign -> bool) ->
(CampaignService_types.campaign -> AdGroupService_types.adGroup -> bool) ->
(CampaignService_types.campaign ->
AdGroupService_types.adGroup -> CriterionService_types.criterion -> bool) ->
(CampaignService_types.campaign ->
AdGroupService_types.adGroup -> CriterionService_types.criterion -> unit) ->
unit
filter_iter_criteria svcs test1 test2 test3 f calls f campaign adgroup criterion for each criterion which matches test1 campaign and test2 campaign adgroup and test3 campaign adgroup criterion. Exceptions are printed and ignored. Not thread safe.
val filter_iter_criteria2 : Adwords.services ->
(CampaignService_types.campaign -> bool) ->
(CampaignService_types.campaign -> AdGroupService_types.adGroup -> bool) ->
(CampaignService_types.campaign ->
AdGroupService_types.adGroup -> CriterionService_types.criterion -> bool) ->
(CampaignService_types.campaign ->
AdGroupService_types.adGroup ->
CriterionService_types.criterion list -> unit) ->
unit
filter_iter_criteria2 svcs test1 test2 test3 f calls f campaign adgroup criteria once for each adgroup, with a a list of criteria which matches test1 campaign and test2 campaign adgroup and test3 campaign adgroup criterion. Exceptions are printed and ignored. Not thread safe.
val active_campaign : CampaignService_types.campaign -> bool
Returns true iff campaign is Active or Paused.
val active_adgroup : CampaignService_types.campaign -> AdGroupService_types.adGroup -> bool
Returns true iff adgroup is Enabled or Paused.
val active_criterion : CampaignService_types.campaign ->
AdGroupService_types.adGroup -> CriterionService_types.criterion -> bool
Returns true iff criterion is Normal, InTrial or OnHold, and is not a negative.
val copy_campaign : Adwords.services ->
?verbose:bool ->
?transform_campaign:(CampaignService_types.campaign ->
CampaignService_types.campaign option) ->
?transform_adgroup:(int32 ->
AdGroupService_types.adGroup ->
AdGroupService_types.adGroup option) ->
?transform_criterion:(int32 ->
AdGroupService_types.adGroup ->
CriterionService_types.criterion ->
CriterionService_types.criterion option) ->
?transform_creative:(int32 ->
AdGroupService_types.adGroup ->
CreativeService_types.creative ->
CreativeService_types.creative option) ->
?src_services:Adwords.services ->
CampaignService_types.campaign ->
string -> CampaignService_types.campaign option
copy_campaign svcs campaign new_name makes a duplicate of a complete campaign with a new name. The new campaign object is returned.

You can supply some optional ?transform_* functions which transform the relevant campaigns / adgroups / criteria / creatives in user-defined ways. For example you can use this function to copy an entire campaign but change a particular word in the adverts into another word. The default transform functions are the identity function (ie. no transformation happens). If a transform function returns None then the object is not copied.

You can supply optional ?src_services services. You can use this, amongst other things, to copy campaigns between accounts. See file campaign.ml for how to do this.

Not thread safe unless you supply suitable ?src_services.

val copy_adgroup : Adwords.services ->
?verbose:bool ->
?transform_adgroup:(int32 ->
AdGroupService_types.adGroup ->
AdGroupService_types.adGroup option) ->
?transform_criterion:(int32 ->
AdGroupService_types.adGroup ->
CriterionService_types.criterion ->
CriterionService_types.criterion option) ->
?transform_creative:(int32 ->
AdGroupService_types.adGroup ->
CreativeService_types.creative ->
CreativeService_types.creative option) ->
?src_services:Adwords.services ->
AdGroupService_types.adGroup ->
CampaignService_types.campaign ->
string -> AdGroupService_types.adGroup option
copy_adgroup svcs adgroup new_campaign new_name makes a duplicate of a complete adgroup within new_campaign with a new name. The new adGroup object is returned.

You can supply some optional ?transform_* functions which transform the relevant adgroups / criteria / creatives in user-defined ways. For example you can use this function to copy an entire adgroup but change a particular word in the adverts into another word. The default transform functions are the identity function (ie. no transformation happens). If a transform function returns None then the object is not copied.

You can supply optional ?src_services. You can use this, amongst other things, to copy adgroups between accounts. See file adgroup.ml for how to do this.

Not thread safe unless you supply suitable ?src_services.