Google AdWords API – Part 4

The fourth part from my AdWords article series is about the TargetingIdeaService. For a project I needed to get search volume and competition for each keyword. This is not as simple as getting clicks or impressions for keywords.

Problem

The main problem is, that you can not get those values from AdGroupCriterionService like all other values. So we have to query another service only for this two missing values. This service is calles TargetingIdesService.

Solution

I wrote a function that gets the search volume and competition as text for the keyword which is set as param. Like all other services, I also need the AdWords user object and the used AdWords version as string. The function returns the requested values as array:

The function looks as follows:

This service is a bit different. It does not use a selector class. We set the requestType to STATS, because we only want data for existing keywords and the ideaType is KEYWORD. For the requestedAttributeTypes array we define all fields that we want from AdWords API. It is really important to use searchParameters array, so we only get values for the needed keywords.

Part 1 | Part 2 | Part 3 | Part 5 | Part 6

(Visited 1,122 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *