is their anyway to get a specific campaign's GeoTargetList targets. ?

Basically i access all the campaigns and use a selector to access the
particular campaign's targets. But from there, i am having trouble
accessing the geotarget list. is their any examples to access that
data?



Code Below
-------------------------------------------------------------------------------------------------





Dim AdwordsCampaignID, CampaignName, Status As String
 Dim TargetAll, Scheduled As Boolean
Dim CampaignID As Integer

Dim campaignService As CampaignService =
user.GetService(AdWordsService.v200909.CampaignService)
        campaignService.RequestHeader.clientEmail = Email

        Try
            ' Get all campaigns.
            Dim page As CampaignPage = campaignService.get(New
CampaignSelector)
            Log("GetAdwordsListingsV2009", "Number of Entries for " &
Email & ": " & page.totalNumEntries)


            ' Display campaigns.
            If (((page) IsNot Nothing) AndAlso ((page.entries) IsNot
Nothing)) Then
                If (page.entries.Length > 0) Then
                    For Each campaign As Campaign In page.entries

                        AdwordsCampaignID = campaign.id.ToString
                        CampaignName = campaign.name.ToString
                        TargetAll = False 'need to do
                        Scheduled = False 'need to do
                        Select Case campaign.status
                            Case CampaignStatuses.ACTIVE
                                Status = "ACTIVE"
                            Case CampaignStatuses.DELETED
                                Status = "DELETED"
                            Case CampaignStatuses.PAUSED
                                Status = "PAUSED"
                        End Select

                        Dim campaignIds() As Long =
{AdwordsCampaignID}
                        campaignIds(0) = AdwordsCampaignID


                        ' Get all Campaign Targets.
                        Dim CampaignTargetService As
CampaignTargetService =
user.GetService(AdWordsService.v200909.CampaignTargetService)

 
CampaignTargetService.RequestHeader.clientEmail = Email

                        Dim CampaignTargetSelector As
CampaignTargetSelector = New CampaignTargetSelector()
                        CampaignTargetSelector.campaignIds =
campaignIds

                        Try
                            Dim CampaignTargetPage As
CampaignTargetPage = CampaignTargetService.get(CampaignTargetSelector)

                            ' Display campaigns Targets.
                            If (((CampaignTargetPage) IsNot Nothing)
AndAlso ((CampaignTargetPage.entries) IsNot Nothing)) Then
                                For Each TargetList As TargetList In
CampaignTargetPage.entries
                                       If TargetList.TargetListType =
"GeoTargetList" Then

                                       end if
                                Next
                            Else
                                Log("GetAdwordsListingsV2009", "No
campaigns targets were found.")
                            End If
                        Catch ex As Exception
                            Throw New Exception("googleV2009
GetAllCampaignsForIndividualAccount Error: " & ex.Message &
ex.StackTrace)
                        End Try

                        'Uncomment CampaignID =
GoogleDB.SaveCampaigns(AccountID, AdwordsCampaignID, CampaignName,
TargetAll, Scheduled, Status)

                        'Console.WriteLine(("Campaign with id = '{0}',
name = '{1}' and status = '{2}'" + " was found."), campaign.id,
campaign.name, campaign.status)
                    Next
                Else
                    Log("GetAdwordsListingsV2009", "No campaigns were
found.")
                End If
            End If
        Catch ex As Exception
            Throw New Exception("googleV2009
GetAllCampaignsForIndividualAccount Error: " & ex.Message &
ex.StackTrace)

        End Try

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to