Setting clientCustomerId outside adsapi

57 views
Skip to first unread message

Alan Coleman

unread,
Feb 15, 2018, 10:34:31 AM2/15/18
to AdWords API Forum
Hello everyone,

I'm trying to upgrade our PHP AdWords API Application to the new library.

I can see that clientCustomerId is set in adsapi_php,ini.

However I need to be able to set the clientCustomerId inside my own application in the same manner as is possible with the old library, with the user object:

$user->SetClientCustomerId(xxxxxx)


I can see that the new session object has a clientCustomerId 'getter' method, but there doesn't seem to be a 'setter' available.

$session->getClientCustomerId()

Can anyone advise on how they are setting they are setting the clientCustomerId?

Any help would be appreciated.

Many thanks

Alan Coleman

unread,
Feb 15, 2018, 10:46:04 AM2/15/18
to AdWords API Forum
I can see that there's a Python method documented below, however I'm looking for PHP:

Milind Sankeshware (AdWords API Team)

unread,
Feb 15, 2018, 5:15:08 PM2/15/18
to AdWords API Forum
Hi Alan,

You can set the clientCusotmerId while creating an AdWords session as shown below:

$session = (new AdWordsSessionBuilder())
->withOAuth2Credential($oAuth2Credential)
->withClientCustomerId(clientCustomerId)
->build();

But, there isn't a method available to set the clientCustomerId once the session is built. Please check sample code to set client customer id at run time.

Thank,
Milind, AdWords API Team.

Alan Coleman

unread,
Feb 16, 2018, 6:31:23 AM2/16/18
to AdWords API Forum
Perfect, thank very much for your help.
Reply all
Reply to author
Forward
0 new messages