RE: an error occurred while uploading adjustments

2024-04-12 Thread 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
Hi,

Thank you for reaching out to the Google Ads API support team.

Upon checking the code, I noticed that you encountered the error 
'NO_CONVERSION_ACTION_FOUND' while adjusting the conversions. This error 
usually occurs when the conversion action specified in the upload request 
cannot be found. There are a few prerequisites that should be followed before 
adjusting the conversions. Make sure all of the prerequisites are satisfied 
before proceeding to implementation. Kindly refer to the document requirements 
for more information.

However, your issue remains unresolved, Please get back to us the complete API 
logs (request and response with request-id and request header) generated at 
your end so that we can check from our end and assist you further. For this, 
you have to enable logging if you are using a client library.

You can refer to the PHP guides to enable logging on your end. For REST 
interface requests, you can enable logging via the curl command by using the -i 
flag.

You can send the details via the Reply privately to the author option or a 
direct private reply to this email.

This message is in relation to case "ref:!00D1U01174p.!5004Q02tP3T9:ref" 
(ADR-00230878)

Thanks,

Google Ads API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/3yCJr0SBUF1500dDqTkd1BRnaP2r4t90CAfA%40sfdc.net.


An error occurred while uploading adjustments

2024-04-11 Thread Kazumasa Sato
An error occurred while uploading adjustments.
I am asking this question because I would like to resolve the error.
I tried to upload the adjustment by referring to the article at the URL 
below.

https://developers.google.com/google-ads/api/docs/conversions/upload-adjustments?hl=ja

When I tried to upload, the following error message was output.
Error Message: 'The conversion action specified in the adjustment request 
cannot be found. Make sure it's available in this account., at 
conversion_adjustments[0].conversion_action'.

Environment
 TimeZone: Asia/Tokyo
 Language:PHP 8.0.30
 Framework:Laravel 8.75
 Google Ads API : V15
 RDB : Mysql 8.0.34

The actual code is as follows.

 START 

namespace App\Console\Commands;

use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Http\File;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Mail;
use Doctrine\Instantiator\Exception\UnexpectedValueException;
use GetOpt\GetOpt;
use Google\ApiCore\ApiException;
use Google\Ads\GoogleAds\Examples\Utils\ArgumentNames;
use Google\Ads\GoogleAds\Examples\Utils\ArgumentParser;
use Google\Ads\GoogleAds\V15\Errors\GoogleAdsError;
use Google\Ads\GoogleAds\V15\Services\UploadClickConversionsResponse;

use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder;
use Google\Ads\GoogleAds\Lib\V15\GoogleAdsClient;
use Google\Ads\GoogleAds\Lib\V15\GoogleAdsClientBuilder;
use Google\Ads\GoogleAds\Util\V15\ResourceNames;
use Google\Ads\GoogleAds\V15\Services\ClickConversion;
use Google\Ads\GoogleAds\V15\Services\ClickConversionResult;
use Google\Ads\GoogleAds\V15\Services\ConversionAdjustment;
use Google\Ads\GoogleAds\V15\Services\ConversionAdjustmentResult;
use Google\Ads\GoogleAds\V15\Services\GclidDateTimePair;
use Google\Ads\GoogleAds\V15\Services\RestatementValue;
use 
Google\Ads\GoogleAds\V15\Enums\ConversionAdjustmentTypeEnum\ConversionAdjustmentType;
use Google\Ads\GoogleAds\V15\Services\CustomVariable;

use App\Models\Evaluation;
use App\Models\ReferSite;
use App\Models\ConversionAction;

use App\Services\ChatWorkService;

class GoogleCooperationCommand extends Command
{
/**
 * The name and signature of the console command.
 *
 * @var string
 */
protected $signature = 'command:googleCooperation';

/**
 * The console command description.
 *
 * @var string
 */
protected $description = 'Google API Collaboration';

/**
 * MCC Account ID
 *
 * @var [type]
 */
protected $customer_id = null;
protected $alert_message_header = null;
protected $alert_messages = [];
protected $execute_count = 0;
protected $success_count = 0;
protected $new_count = 0;
protected $adjust_count = 0;


/**
 * Create a new command instance.
 *
 * @return void
 */
public function __construct()
{
parent::__construct();
$this->customer_id = config('app.google.customer_id');
}

/**
 * Execute the console command.
 *
 * @return int
 */
public function handle()
{
$now_date = Carbon::now()->format("Y-m-d H:i:s");
$dial_ids = ReferSite::where('start_date', '<=', $now_date)
->where('end_date', '>=', $now_date)
->pluck('dial_id')
->toArray();
$dial_ids = array_unique($dial_ids);

$from_date = Carbon::now()->format("Y-m-d") . " 00:00:00";
$dist_date = Carbon::now()->format("Y-m-d") . " 23:59:59";
$ini_file = $this->project_root . '/google_ads_php.ini';

$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile($ini_file)
->build();

$this->google_ads_client = (new GoogleAdsClientBuilder())
->fromFile($ini_file)
->withOAuth2Credential($oAuth2Credential)
->build();

try {
foreach($dial_ids as $dial_id) {
$this->alert_message_header = "";
$this->alert_messages = [];
$this->execute_count = 0;
$this->success_count = 0;
$this->new_count = 0;
$this->adjust_count = 0;
$refer_site = ReferSite::where('dial_id', '=', 
$dial_id)->first();
$this->alert_message_header = "GOOGLE 
{$refer_site->site_name}[ID:{$refer_site->dial_id}]";

$new_evaluation_ids = Evaluation::where('dial_id', '=', 
$dial_id)
->where('import_count', '=', 0)
->whereIn('source', ['google_ads', 
'google_adwords', 

An error occurred while uploading adjustments.

2024-04-11 Thread Kazumasa Sato
An error occurred while uploading adjustments.
I am asking this question because I would like to resolve the error.
I tried to upload the adjustment by referring to the article at the URL 
below.

https://developers.google.com/google-ads/api/docs/conversions/upload-adjustments?hl=ja

When I tried to upload, the following error message was output.
Error Message: 'The conversion action specified in the adjustment request 
cannot be found. Make sure it's available in this account., at 
conversion_adjustments[0].conversion_action'.

Environment
 TimeZone: Asia/Tokyo
 Language:PHP 8.0.30
 Framework:Laravel 8.75
 Google Ads API : V15
 RDB : Mysql 8.0.34

The actual code is as follows.

 START 

namespace App\Console\Commands;

use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Http\File;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Mail;
use Doctrine\Instantiator\Exception\UnexpectedValueException;
use GetOpt\GetOpt;
use Google\ApiCore\ApiException;
use Google\Ads\GoogleAds\Examples\Utils\ArgumentNames;
use Google\Ads\GoogleAds\Examples\Utils\ArgumentParser;
use Google\Ads\GoogleAds\V15\Errors\GoogleAdsError;
use Google\Ads\GoogleAds\V15\Services\UploadClickConversionsResponse;

use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder;
use Google\Ads\GoogleAds\Lib\V15\GoogleAdsClient;
use Google\Ads\GoogleAds\Lib\V15\GoogleAdsClientBuilder;
use Google\Ads\GoogleAds\Util\V15\ResourceNames;
use Google\Ads\GoogleAds\V15\Services\ClickConversion;
use Google\Ads\GoogleAds\V15\Services\ClickConversionResult;
use Google\Ads\GoogleAds\V15\Services\ConversionAdjustment;
use Google\Ads\GoogleAds\V15\Services\ConversionAdjustmentResult;
use Google\Ads\GoogleAds\V15\Services\GclidDateTimePair;
use Google\Ads\GoogleAds\V15\Services\RestatementValue;
use 
Google\Ads\GoogleAds\V15\Enums\ConversionAdjustmentTypeEnum\ConversionAdjustmentType;
use Google\Ads\GoogleAds\V15\Services\CustomVariable;

use App\Models\Evaluation;
use App\Models\ReferSite;
use App\Models\ConversionAction;

use App\Services\ChatWorkService;

class GoogleCooperationCommand extends Command
{
/**
 * The name and signature of the console command.
 *
 * @var string
 */
protected $signature = 'command:googleCooperation';

/**
 * The console command description.
 *
 * @var string
 */
protected $description = 'Google API Collaboration';

/**
 * MCC Account ID
 *
 * @var [type]
 */
protected $customer_id = null;
protected $alert_message_header = null;
protected $alert_messages = [];
protected $execute_count = 0;
protected $success_count = 0;
protected $new_count = 0;
protected $adjust_count = 0;


/**
 * Create a new command instance.
 *
 * @return void
 */
public function __construct()
{
parent::__construct();
$this->customer_id = config('app.google.customer_id');
}

/**
 * Execute the console command.
 *
 * @return int
 */
public function handle()
{
$now_date = Carbon::now()->format("Y-m-d H:i:s");
$dial_ids = ReferSite::where('start_date', '<=', $now_date)
->where('end_date', '>=', $now_date)
->pluck('dial_id')
->toArray();
$dial_ids = array_unique($dial_ids);

$from_date = Carbon::now()->format("Y-m-d") . " 00:00:00";
$dist_date = Carbon::now()->format("Y-m-d") . " 23:59:59";
$ini_file = $this->project_root . '/google_ads_php.ini';

$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile($ini_file)
->build();

$this->google_ads_client = (new GoogleAdsClientBuilder())
->fromFile($ini_file)
->withOAuth2Credential($oAuth2Credential)
->build();

try {
foreach($dial_ids as $dial_id) {
$this->alert_message_header = "";
$this->alert_messages = [];
$this->execute_count = 0;
$this->success_count = 0;
$this->new_count = 0;
$this->adjust_count = 0;
$refer_site = ReferSite::where('dial_id', '=', 
$dial_id)->first();
$this->alert_message_header = "GOOGLE 
{$refer_site->site_name}[ID:{$refer_site->dial_id}]";

$new_evaluation_ids = Evaluation::where('dial_id', '=', 
$dial_id)
->where('import_count', '=', 0)
->whereIn('source', ['google_ads', 
'google_adwords',