Get campaigns with their photos

25 views
Skip to first unread message

Krzysztof Rodo

unread,
Nov 12, 2020, 2:35:16 PM11/12/20
to AdWords API and Google Ads API Forum
Hi,
I need to fetch: |Name of campaign||Impressions|Cost||Conversation Rate||Conversions||Date||Budget||Image/Video of this ad||
Can I fetch it all from campaign entity? How?

        $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();
        // Creates a query that retrieves all campaigns.
        $query = 'SELECT [MYLIST]  FROM campaign ORDER BY campaign.name';
        // Issues a search stream request.
        /** @var GoogleAdsServerStreamDecorator $stream */
        $stream =
            $googleAdsServiceClient->searchStream($customerId, $query);

            // Iterates over all rows in all messages and prints the requested field values for
            // the campaign in each row.
            foreach ($stream->iterateAllElements() as $googleAdsRow) {
                /** @var GoogleAdsRow $googleAdsRow */
                printf(
                "Campaign with ID %d and name '%s' was found.%s",
                $googleAdsRow->getCampaign()->getId(),
                $googleAdsRow->getCampaign()->getName(),
                AND SOMETHING HERE
                PHP_EOL
            );
        }


Reply all
Reply to author
Forward
0 new messages