GAQL Insert PHP variable in query

97 views
Skip to first unread message

scratch27

unread,
Mar 3, 2022, 2:47:48 PM3/3/22
to Google Ads API and AdWords API Forum
Hi,

I would like to create a query with a php variable for the WHERE statement.
Here is an example:
$query = "SELECT campaign.name FROM ad_group WHERE ad_group.id = $adGroupId";

I am using PHP library and I want to insert dynamic values in queries that I can get for example from the frontend 

Thank you for your help!

Mat

Google Ads API Forum Advisor

unread,
Mar 4, 2022, 11:10:32 AM3/4/22
to azertyuiopqsdf...@gmail.com, adwor...@googlegroups.com
Hi there,

For support for the PHP Client Library you may reach out to their issue tracker . With that being said, here is an example of  passing a variable to a 'WHERE' clause.

Regards,

Google Logo
Aryeh
Google Ads API Team
 


ref:_00D1U1174p._5004Q2XlCsP:ref

scratch27

unread,
Mar 4, 2022, 12:55:31 PM3/4/22
to Google Ads API and AdWords API Forum
Exactly what I needed, thank you so much!

Mat

Reply all
Reply to author
Forward
0 new messages