From 719238911a8c72f9802147270314e196ba7452be Mon Sep 17 00:00:00 2001 From: huangguancheng Date: Fri, 10 Jan 2025 11:54:12 +0800 Subject: [PATCH] =?UTF-8?q?google=E5=88=87=E6=8D=A2=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E5=B9=BF=E5=91=8A=E5=BC=80=E5=8F=91=E8=80=85=E4=BB=A4=E7=89=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/event/GoogleAdsCustomers.php | 4 ++++ config/google_ads_php.ini | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/event/GoogleAdsCustomers.php b/app/event/GoogleAdsCustomers.php index 237db5e..65b0612 100644 --- a/app/event/GoogleAdsCustomers.php +++ b/app/event/GoogleAdsCustomers.php @@ -58,6 +58,10 @@ class GoogleAdsCustomers $option['manager_customer_id'] = 1401879025; //开发者 $option['login_customer_id'] = 1401879025; } + }else{ + //正式开发者令牌2个参数默认不赋值 +// $option['manager_customer_id'] = $listAccessibleCustomers[0]; //开发者 +// $option['login_customer_id'] = $listAccessibleCustomers[0]; } $allRootAccounts = $this->googleAdsAccountService->runGetAccountHierarchy($option); // dump($allRootAccounts); diff --git a/config/google_ads_php.ini b/config/google_ads_php.ini index a222742..93f4195 100644 --- a/config/google_ads_php.ini +++ b/config/google_ads_php.ini @@ -1,7 +1,8 @@ [GOOGLE_ADS] ; Required some config parameters, which can be found at: ; https://developers.google.com/google-ads/api/docs/first-call/overview#config -developerToken = "C5wRcPCLwubnNgOEqweLBA" +; +developerToken = "Q-U_mAoZPY-JRnDJrYEN4Q" ; The configuration setting name for a flag that specifies whether to use the Google @@ -14,7 +15,7 @@ developerToken = "C5wRcPCLwubnNgOEqweLBA" ; in code if your application uses multiple manager account + OAuth pairs. It should be set ; without dashes, for example: 1234567890 instead of 123-456-7890. ; loginCustomerId = "INSERT_LOGIN_CUSTOMER_ID_HERE" -loginCustomerId = 1509096882 +;loginCustomerId = 1509096882 ; This header is only required for methods that update the resources of an entity when permissioned ; via Linked Accounts in the Google Ads UI (AccountLink resource in the Google Ads API). Set this ; value to the customer ID of the data provider that updates the resources of the specified @@ -30,8 +31,8 @@ loginCustomerId = 1509096882 ; appropriate flow based on your use case. ; For installed application flow. -clientId = "117429539543-t73vtg7v1vag5b2dg68qaaaj00gmacjs.apps.googleusercontent.com" -clientSecret = "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" +clientId = "812178782913-1fpv68j8l90rell4elf9ougfn9d0aq72.apps.googleusercontent.com" +clientSecret = "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" ;refreshToken = "1//0eNpv3UrnIRMaCgYIARAAGA4SNwF-L9Ir_W9Fs5CrdW_7IFjRkq2nA6TZwSyi9Y8ukj8nirWt3BvOR74j3HatYX3cug7vfzGPUhs" ; For service account flow. @@ -54,7 +55,7 @@ logLevel = "INFO" ; Optional transport settings. ; By default, "grpc" is used if available otherwise "rest". ; transport = "grpc" -transport = "rest" +transport = "grpc" ; Optional gRPC channel settings. ; Whether the gRPC channel to use is secure or not. Insecure gRPC channels should not be used in ; production because they do not use encryption or authentication, they should only be used for