tracking_url_template can't be removed

128 views
Skip to first unread message

Cristiano De Luca

unread,
Mar 14, 2022, 10:13:59 AM3/14/22
to Google Ads API and AdWords API Forum
Hi all,
I'm using Google Ads API with php lib,
How can I remove the tracking_url_template from a campaign?

I tried it passing this arguments to fieldMask:
1.) 'tracking_url_template' => ""
2.) 'tracking_url_template' => null
but neither work.
How i can do this?

this is my example code:
        $resourceName = ResourceNames::forCampaign($client_customer_id, $camp->id_campaign);

        $campaign = new Campaign([
            'resource_name' => $resourceName,
            'tracking_url_template' => ""
        ]);

        $campaignOperation = new CampaignOperation();
        $campaignOperation->setRemove($campaign);
        $campaignOperation->setUpdateMask(FieldMasks::allSetFieldsOf($campaign));

        $campaignServiceClient = $googleAdsClient->getCampaignServiceClient();

        $response = $campaignServiceClient->mutateCampaigns(
            $client_customer_id,
            [$campaignOperation]
        );

Google Ads API Forum Advisor

unread,
Mar 15, 2022, 1:31:45 AM3/15/22
to cris...@syrus.it, adwor...@googlegroups.com
Hi Cristiano,

Thank you for your question.

To set the said field to null, you may include the tracking URL template in the field mask without specifying any value. Meaning, it shouldn't appear in the request body, just in the field mask. Let us know how this goes on your end.

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Yl5RU:ref

Cristiano De Luca

unread,
Mar 15, 2022, 4:48:25 AM3/15/22
to Google Ads API and AdWords API Forum
Thank you Peter for your answer .

Based on the code I wrote you could you tell me exactly how to remove the tracking url template?
Maybe a code example (template) to always use, then I adapt it to my code.
Also which methods to use and which instances?

Google Ads API Forum Advisor

unread,
Mar 15, 2022, 9:05:59 AM3/15/22
to cris...@syrus.it, adwor...@googlegroups.com
Hi Cristiano,

This channel only provides general API support and for PHP client library support, you can post on this forum. Please see this page that discusses field masks in the PHP client library. 

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Yl5RU:ref

Ngon Nguyen

unread,
Mar 17, 2022, 8:25:33 PM3/17/22
to cris...@syrus.it, Google Ads API and AdWords API Forum
Chào mừng bạn đến với bảng nhớ tạm của Gboard, bất kỳ văn bản nào bạn sao chép sẽ được lưu tại đây.Sử dụng biểu tượng chỉnh sửa để ghim, thêm hoặc xóa đoạn.Nhấn vào một đoạn để dán vào hộp văn bản.Chạm và giữ một đoạn để ghim đoạn đó. Các đoạn đã bỏ ghim sẽ bị xóa sau 1 giờ.

Vào 21:14, Th 2, 14 thg 3, 2022 Cristiano De Luca <cris...@syrus.it> đã viết:
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/87b579c5-181b-4615-9966-d5d0de6cabe5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages