Hello,
I'm having some trouble trying to upload click conversions using the api.
The error I'm receiving is:
This customer does not have an import conversion action that matches the conversion action provided
Let me provide me some context as how we've come to receive this error.
Our account structure:
Some notes:
- We use the Manager accounts id as customerId.
- The import from clicks conversion action is configured under the Manager.
- For testing purposes we've generated a gclid from a campaign that does not use cross account actions.
Authentication and client setup
The $loginCustomerId corresponds with the Manager id formatted to int.
---
$oAuth2Credential = (new \Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder())->from($configuration)->build();
$googleAdsClient = (new GoogleAdsClientBuilder())
->withOAuth2Credential($oAuth2Credential)
->withDeveloperToken($developerToken)
->withLoginCustomerId($loginCustomerId)
->build()
;
Retrieving the action through the api
Because of the error I made an attempt to fetch the action through the api to make sure that we're using the correct customerId and actionId.
---
$action = $googleAdsClient->getConversionActionServiceClient()->getConversionAction(ResourceNames::forConversionAction($loginCustomerId, $actionId));
echo $action->getOwnerCustomer(); // Same as $loginCustomerId
echo $action->getId(); // Same as $actionId
Uploading click conversion
The following snippet attempts to upload the conversion. The $loginCustomerId and $actionId haven't changed from the snippets above.
---
$clickConversion = new ClickConversion([
'gclid' => 'Generated gclid from Account 1',
'conversion_action' => ResourceNames::forConversionAction($loginCustomerId, $actionId),
'conversion_value' => 0.01,
'conversion_date_time' => (new \DateTime())->format('Y-m-d H:i:sP'),
'currency_code' => 'EUR',
]);
$uploadClient = $googleAdsClient->getConversionUploadServiceClient();
$response = $uploadClient->uploadClickConversions($loginCustomerId, [$clickConversion], true);
The
documentation has a lot of criteria that must be in place for this in order to work and I've been trying to make sense of them all. I'm just going to duplicate them here, and write down my comments.
- The ConversionActionType is UPLOAD_CLICKS.
- $action->getType() returns 7 === UPLOAD_CLICKS.
- The status of the ConversionAction is ENABLED.
- It's enabled in the UI dashboard.
- The ConversionAction exists in the effective conversion account of the click's Google Ads account.
- This one has me doubting - the click comes from a account that does not have cross-account conversions enabled, but is still using it's own conversion goals pulled from Google Analytics.
- At the time of the click, conversion tracking was enabled in the effective conversion account of the click's Google Ads account.
- I'm not sure what this means - help?
- Starting with v8 of the Google Ads API, the customer_id of the UploadClickConversionsRequest must be the customer ID of the owner_customer of each click conversion's conversion_action.
- The action's owner is the same as our $loginCustomerId.
I'm having the idea that the account from which the click originated needs to have cross account tracking configured for this to work properly? Could someone please confirm this that this is a problem?