How to upload user data csv file in adwords account using PHP API

110 views
Skip to first unread message

avinas...@profecialinks.com

unread,
Nov 5, 2018, 5:16:01 AM11/5/18
to AdWords API and Google Ads API Forum
I have hash encrypted user data saved in csv file. I want to run PHP cron which will insert those records into Google adwords account. I checked for googleads-php-lib but don't know how to use this. Is there any other library or ready php script.

On another side when I tried to use googleads-php-lib, it need to clientId, client-secret, developer token & refresh token. When trying to get refresh token it throws an below error message:
Error: redirect_uri_mismatch
The redirect URI in the request, urn:ietf:wg:oauth:2.0:oob, can only be used by a Client ID for native application. It is not allowed for the WEB client type. You can create a Client ID for native application at https://console.developers.google.com/apis/credentials/oauthclient

What exactly this error and how to solve. Please help.

Teja Makani

unread,
Nov 5, 2018, 12:14:42 PM11/5/18
to AdWords API and Google Ads API Forum
Hello Avinash,

Could you please elaborate this "encrypted user data saved in csv file" and the scenario you are trying to assist you further? 

Please note that redirect_uri_mismatch may occurs because of different application type(Web or installed application), you have to use correct application type and then generate the OAuth credentials again. You could refer this guide to generate OAuth credentials. Let me know if you have any further questions.

Regards,
Sai Teja, AdWords API Team.

الشيخ الروحاني الحاج رشيد الكندي

unread,
Nov 5, 2018, 12:20:15 PM11/5/18
to AdWords API and Google Ads API Forum
Ads

avinas...@profecialinks.com

unread,
Nov 6, 2018, 12:04:07 AM11/6/18
to AdWords API and Google Ads API Forum
Hello Teja,

Will you please help & tell me apart from googleads-php-lib which API is used to add data in Google AdWords account.
OR how can I upload user csv file using which API.

Teja Makani

unread,
Nov 6, 2018, 2:19:54 PM11/6/18
to AdWords API and Google Ads API Forum
Hello Avinash,

You could upload data to AdWords using any of the client libraries mentioned here. To install and use them go-to the README.md file on those libraries and follow the instructions mentioned there. Could you please confirm whether you are trying to upload offline conversions to the AdWords account as a csv file using the API? In such case, you wont be able to do that. You can instead read the contents of it via a program and then upload to the AdWords account using offlineConversionFeedService. You could also refer this guide for more information and code samples. You could also use the UI to import the data. Please check here for more details. If your questions is different please elaborate.

avinas...@profecialinks.com

unread,
Nov 8, 2018, 12:21:00 PM11/8/18
to AdWords API and Google Ads API Forum
Hello,

We can set schedule to upload Conversions.

upload_conversions.PNG



is there any way from where we can set schedule to upload customer list.

create_audience.PNG


We can achieve this as explained here. Can we do the same job like upload conversion?


On Monday, November 5, 2018 at 3:46:01 PM UTC+5:30, avinas...@profecialinks.com wrote:

Teja Makani

unread,
Nov 8, 2018, 2:55:31 PM11/8/18
to AdWords API and Google Ads API Forum
Hello Avinash,

You cannot scheduled the conversions as shown in the UI but you will be able to scheduled your upload conversions job like scheduling any other program at your end. You will be able to upload the offline conversions using offlineConversionFeedService, you have to read the content of your csv file and then using the specified service you will be able to upload them one by one as explained earlier. You could refer to the code sample UploadOfflineConversions.java, code samples in other languages can be found here. Let me know if you have any further questions.


Regards,
Sai Teja, AdWords API Team.

avinas...@profecialinks.com

unread,
Nov 10, 2018, 1:15:38 PM11/10/18
to AdWords API and Google Ads API Forum
I got developer token, client id, client secret & refresh token. Set all the things inside adsapi_php.ini and placed this file in home directory C:/Users/myaccount/adsapi_php.ini
When trying to test API using GetCampaigns.php, getting below error:
Uncaught InvalidArgumentException: A developer token must be set.

developer_token_error.PNG

Why getting this error even placed all the things inside adsapi_php.ini


On Monday, November 5, 2018 at 3:46:01 PM UTC+5:30, avinas...@profecialinks.com wrote:

remerson menese

unread,
Nov 12, 2018, 4:15:06 AM11/12/18
to AdWords API and Google Ads API Forum
me too, I lkie you a problem, I havew no deal to fix that

Teja Makani

unread,
Nov 12, 2018, 2:58:43 PM11/12/18
to AdWords API and Google Ads API Forum
Hello Avinash,

Could you please double check the adsapi_php.ini file to make sure the properties are not commented? If you are still facing the problem could you please share the properties file to take a closer look? You could reply privately to the author while responding.


Regards,
Sai Teja, AdWords API Team.

Reply all
Reply to author
Forward
0 new messages