How to get campaigns targeted location group using api

135 views
Skip to first unread message

Anil

unread,
Jun 17, 2016, 6:23:41 AM6/17/16
to AdWords API Forum
Hello,

We have campaign where location group is targeted "***** top 10% (US) within United States".
To get locations targeted via API we have used Campaign Criterion service where we get this under location groups where only id is mentioned. 
How can we get the actual group name like "****top 10% (US) within United States"?

Below is the sample of API response :

[criterion] => LocationGroups Object
                (
                    [feedId] => 
                    [matchingFunction] => FeedFunction Object
                        (
                            [operator] => AND
                            [lhsOperand] => Array
                                (
                                    [0] => IncomeOperand Object
                                        (
                                            [tier] => TIER_1
                                            [FunctionArgumentOperandType] => IncomeOperand
                                            [_parameterMap:FunctionArgumentOperand:private] => Array
                                                (
                                                    [FunctionArgumentOperand.Type] => FunctionArgumentOperandType
                                                )

                                        )

                                )

                            [rhsOperand] => Array
                                (
                                    [0] => GeoTargetOperand Object
                                        (
                                            [locations] => Array
                                                (
                                                    [0] => 2840
                                                )

                                            [FunctionArgumentOperandType] => GeoTargetOperand
                                            [_parameterMap:FunctionArgumentOperand:private] => Array
                                                (
                                                    [FunctionArgumentOperand.Type] => FunctionArgumentOperandType
                                                )

                                        )

                                )

                            [functionString] => AND()
                        )

                    [id] => 197664905835
                    [type] => LOCATION_GROUPS
                    [CriterionType] => LocationGroups
                    [_parameterMap:Criterion:private] => Array
                        (
                            [Criterion.Type] => CriterionType
                        )

                )


Thanks

Shwetha Vastrad (AdWords API Team)

unread,
Jun 17, 2016, 4:13:53 PM6/17/16
to AdWords API Forum
Hi Anil,

Once you have retrieved the complete LocationGroup object using the CampaignCriterionService, you need to decompose the object to get the LhsOperand and RhsOperand of the MatchingFunction used. If the operand is an instance of GeoTargetOperand, use the LocationCriterionService or the GeoTarget table to lookup the name of the location criterion. For other operand types, please refer to the respective documents for the enumerations.

For example, in your case:
TIER_1 represents top 10% of earners. 
2840 is the Criteria ID for United States.

Regards,
Shwetha, AdWords API Team.



 

Sachin Kumar

unread,
Oct 15, 2016, 10:30:52 AM10/15/16
to AdWords API Forum, Harisankar Mohanty
Hi Anil,

What is the function to get household income of geo location? Can you plz share your code?


Thanks & Regrads
Sachin

Shwetha Vastrad (AdWords API Team)

unread,
Oct 17, 2016, 12:41:14 PM10/17/16
to AdWords API Forum, harish....@gmail.com
Hi Sachin,

I see that one of my colleague provided a sample request and response to demonstrate how to get the details of a location group campaign criterion on this forum post. Did that help in getting the IncomeOperand details? 
Reply all
Reply to author
Forward
0 new messages