OK, next up when using the V201101 web service to obtain the campaign
level negative keywords, I obtain the match type but not the text.
Another method that is not backward compatible w/o documentation
outlining - so I assume it is a break that I should be reporting to
the dev team. Please don't shoot the messenger...
Here is my code:
<code>
'Use ArrayList to build Array of Campaign objects to return to call
application
Dim MyArray As New ArrayList
Dim campaignCriterion As
GoogleCampaignCriterionAPI.CampaignCriterion = Nothing
campaignCriterion = New
GoogleCampaignCriterionAPI.CampaignCriterion()
Dim ix As Long = 0
''Create id filter for AdGroupID passed in
'Dim idFilter As New CampaignCriterionIdFilter()
'idFilter.campaignId = myCampaignID
'idFilter.campaignIdSpecified = True
'' Create selector.
'Dim selector As New CampaignCriterionSelector()
'selector.idFilters = New CampaignCriterionIdFilter()
{idFilter}
' Create the selector.
Dim selector As New GoogleCampaignCriterionAPI.Selector
selector.fields = New String() {"CampaignId"}
' Create the filters.
Dim predicate As New GoogleCampaignCriterionAPI.Predicate
predicate.field = "CampaignId"
predicate.operator =
GoogleCampaignCriterionAPI.PredicateOperator.EQUALS
predicate.operatorSpecified = True
predicate.values = New String() {myCampaignID.ToString}
Try
'' Get all keywords.
'Dim page As CampaignCriterionPage = myService.[get]
(selector)
'' Loop keywords.
'ix = 0
selector.predicates = New
GoogleCampaignCriterionAPI.Predicate() {predicate}
Dim page As
GoogleCampaignCriterionAPI.CampaignCriterionPage =
myService.get(selector)
' Loop keywords.
ix = 0
If page IsNot Nothing AndAlso page.entries IsNot Nothing
Then
If page.entries.Length > 0 Then
For Each campaignCriterion In page.entries
If TypeOf campaignCriterion.criterion Is
GoogleCampaignCriterionAPI.Keyword Then
Dim keyword As
GoogleCampaignCriterionAPI.Keyword =
DirectCast(campaignCriterion.criterion,
GoogleCampaignCriterionAPI.Keyword)
Console.WriteLine("Keyword ad group
criterion with criterion ID = '{0}', text =" & " '{1}' and matchType =
'{2} was found.", keyword.id, keyword.text, keyword.matchType)
ElseIf TypeOf campaignCriterion.criterion Is
GoogleCampaignCriterionAPI.Placement Then
Dim placement As
GoogleCampaignCriterionAPI.Placement =
DirectCast(campaignCriterion.criterion,
GoogleCampaignCriterionAPI.Placement)
Console.WriteLine("Placement ad group
criterion criterion ID = '{0}' and url =" & " '{1}' was found.",
placement.id, placement.url)
End If
MyArray.Add(campaignCriterion)
ix += 1
Next
Else
Console.WriteLine("No keywords were found.")
End If
End If
Catch ex As Exception
Console.WriteLine("Failed to retrieve Keywords(s).
Exception says ""{0}""", ex.Message)
End Try
</code>
In the code above I identify this as a keyword and unfortunately the
Keyword.text is blank as per my print statement and debugging:
Keyword ad group criterion with criterion ID = '10886981', text = ''
and matchType = 'BROAD was found.
I again verified this works as designed with V201008 and of course w/n
the AdWords portal. If the solution is to take the KeywordID found
and consume another web service to obtain the text is not efficient.
What is the EOL for V201008, seems like too many bugs in V2011 to
mandate for this month, but with my luck probably is right around the
corner.
Thanks in advance for the patches to these broken web services,
Google. I'll continue to report 'em as I run into 'em... And I am
only at the get stage with setters to come, oh boy.
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en