Campaign level negative Placements - URL empty

25 views
Skip to first unread message

LFI Media

unread,
Jun 11, 2020, 8:49:12 AM6/11/20
to AdWords API and Google Ads API Forum
Hello all,

I'm using v201809 adwords API / PHP and get all Criteria through the CampaignCriterionService.

I can see all placement criteria (the ID's) but i am not able to see the url of a Placement CriterionType..

Snippet:

                    if (CriterionType::KEYWORD === $campaignCriterion->getCriterion()->getType()) {
                        $keyword = $campaignCriterion->getCriterion();
                        printf(
                            "Negative keyword with ID %d and text '%s' was found.\n",
                            $keyword->getId(),
                            $keyword->getText()
                        );
                    } elseif (CriterionType::PLACEMENT === $campaignCriterion->getCriterion()->getType()) {
                        $placement = $campaignCriterion->getCriterion();
                        printf(
                            "Negative placement with ID %d and URL '%s' was found.\n",
                            $placement->getId(),
                            $placement->getUrl()
                        );
                    } else {
                        $criterion = $campaignCriterion->getCriterion();
                        printf(
                            "Criterion with ID %d was found with type %s.\n",
                            $criterion->getId(),
                            $criterion->getType()
                        );
                    }

The $placement->getUrl() always is empty...

Thanks for any help..

Google Ads API Forum Advisor Prod

unread,
Jun 11, 2020, 1:26:57 PM6/11/20
to lafamigliai...@gmail.com, adwor...@googlegroups.com
Hello,

Thank you for reaching out. In order to get the placement URL, you will have to add the field "PlacementUrl" in your selector. Once you have specified the field, try your request again and let me know if you continue to experience the issue. If so, kindly provide the complete detailed logs of your request so that I can look further into what is causing this. 

Regards,
Danica, Google Ads API Team 

ref:_00D1U1174p._5004Q20Y3HT:ref
Reply all
Reply to author
Forward
0 new messages