Hi
>From the example AddConversionAction
<https://github.com/googleads/google-ads-php/blob/4355e2b7c01a57212d09a8905d6b943809f56892/examples/Remarketing/AddConversionAction.php>
i'm
trying to get the tagSnipped via the method getTagSnippeds() but i've got
error:
Uncaught Error: Call to undefined method
Google\Ads\GoogleAds\V5\Services\MutateConversionActionResult::getTagSnippets()
Here is my code logic
// Creates a conversion action.
$conversionAction = new ConversionAction([
'name' => $data->conv_name . uniqid(),
'category' => $data->conv_category,
'type' => ConversionActionType::WEBPAGE,
'status' => ConversionActionStatus::ENABLED,
'value_settings' => new ValueSettings([
'default_value' => $data->conv_value,
'always_use_default_value' => true
])
]);
if ($data->conv_counting_type != null && $data->conv_counting_type
> 0) {
$conversionAction->setCountingType($data->conv_counting_type);
}
if ($data->conv_click_window_days != null &&
$data->conv_click_window_days > 0) {
$conversionAction->setClickThroughLookbackWindowDays($data->conv_click_window_days);
}
if ($data->conv_view_window_days != null &&
$data->conv_view_window_days > 0) {
$conversionAction->setViewThroughLookbackWindowDays($data->conv_view_window_days);
}
// Creates a conversion action operation.
$conversionActionOperation = new ConversionActionOperation();
$conversionActionOperation->setCreate($conversionAction);
// Issues a mutate request to add the conversion action.
$serviceClient = $gaClient->getConversionActionServiceClient();
$response = $serviceClient->mutateConversionActions(
$clientInfo->customer_id,
[$conversionActionOperation]
);
if ($response->getResults()->count() == 0) {
return null;
}
/** @var ConversionAction $addedConversionAction */
$addedConversionAction = $response->getResults()[0];
$globalSiteTag = '';
$eventSnippet = '';
foreach ($addedConversionAction->getTagSnippets() as $tagSnippet) {
/** @var TagSnippet $tagSnippet */
$globalSiteTag = $tagSnippet->getGlobalSiteTag();
$eventSnippet = $tagSnippet->getEventSnippet();
break;
}
plz help me check it.
Vào lúc 11:05:13 UTC+7 ngày Thứ Ba, 27 tháng 10, 2020, Nguyen Mark đã viết:
> Thanks for your supported
>
> Vào lúc 01:39:16 UTC+7 ngày Thứ Ba, 27 tháng 10, 2020, adsapiforumadvisor
> đã viết:
>
>> Hi Nguyen,
>>
>> Thank you for reaching out. There isn’t any service available to fetch
>> the Conversion Id and Label in the existing conversion set up in the
>> Adwords/Google Ads API. The workaround is to delete the old one that wasn’t
>> properly set up and create new conversions to get a new set of Conversion
>> Id and Label.
>>
>> Thanks and regards,
>> Xiaoming, Google Ads API Team
>>
>>
>> [image: Google Logo]
>> Xiaoming
>> Google Ads API Team
>>
>>
>> ref:_00D1U1174p._5004Q274axa:ref
>>
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/62b7fb8b-52dd-4111-bb25-f10a2833e1a2n%40googlegroups.com.