Comments (4)
Hi,
I'm Vergel Aranas. Currently use your package.
How to get all client/account customer Ids?
Could you find a way to get all clients/accounts? Please let me know. Thanks.
from laravel-google-ads.
Hi @ayushiindianic,
Yes, I've find a way to get all clients/accounts. Thanks for you package. It's really helpul.
from laravel-google-ads.
@iceverge
Haha that's not my package. I am also looking for a way to get all clients.
If you know please share the code if possible. Thanks!
from laravel-google-ads.
@ayushiindianic
here is the code.
Get all Account/Clients
`
public function getAllAccounts(Request $request)
{
$oAuth2Credential = $this->oAuth->userCredentials([
'clientId' => config('google-ads.production.clientId'),
'clientSecret' => config('google-ads.production.clientSecret'),
'refreshToken' => $request->refreshToken,
]);
$session = (new AdwordsSession())->buildWithOAuth(config('google-ads.production.developerToken'), $oAuth2Credential);
$managedCustomerService = (new AdWordsServices())->get($session, ManagedCustomerService::class);
$selector = (new Selector())
->setFields(['CustomerId', 'Name'])
->setOrdering([new OrderBy('CustomerId', SortOrder::ASCENDING)]);
$customers = $managedCustomerService->get($selector);
$clients = [];
foreach ($customers->getEntries() as $customer) {
$clients[] = [
'customer_name' => $customer->getName(),
'customer_id' => $customer->getCustomerId()
];
}
return response($clients);
}
`
from laravel-google-ads.
Related Issues (20)
- Error when getting refresh token HOT 2
- How to create/update campaign using this packages ?
- Multiple accounts
- usage for hiearchy accounts HOT 3
- How to install with "googleads/googleads-php-lib": "^40.0"? HOT 7
- AuthenticationError.OAUTH_TOKEN_INVALID HOT 1
- php artisan config:cache HOT 3
- How to add campaign account to MCC account
- The service 'CampaignService' is not found HOT 1
- How to solve guzzle error HOT 3
- Client error: `POST https://oauth2.googleapis.com/token` resulted in a `400 Bad Request` response: { "error": "invalid_grant", "error_description": "Bad Request" }
- Environment HOT 1
- redirect_uri_mismatch HOT 1
- New Google Ads API
- Error while installing Edujugon / laravel-google-ads HOT 2
- count(): Argument #1 ($value) must be of type Countable|array, null given
- AdWords API which you are accessing has been discontinued. Use the new Google Ads API instead. Please visit https://ads-developers.googleblog.com/2021/04/upgrade-to-google-ads-api-from-adwords.html
- Update the google-ads.php file
- nee to Upadate for 2021
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-google-ads.