Nếu cần thao tác trên nhiều loại thực thể cùng lúc hoặc muốn ghi vào một điểm cuối thay vì sử dụng một điểm cuối riêng biệt cho mỗi loại tài nguyên, bạn có thể dùng điểm cuối
GoogleAdsService.Mutate
cho tất cả các thao tác thay đổi được hỗ trợ.
Thay đổi hoạt động
Mỗi MutateGoogleAdsRequest
chấp nhận một MutateOperation
lặp lại, mỗi thao tác có thể bao gồm một thao tác duy nhất cho một loại tài nguyên. Để tạo một
chiến dịch và một nhóm quảng cáo trong một lệnh gọi
GoogleAdsService.Mutate
,
bạn cần phải tạo hai thực thể MutateOperation
(một thực thể cho CampaignOperation
,
một thực thể cho AdGroupOperation
),
sau đó chuyển cả hai vào
GoogleAdsService
.
Ruby
mutate_operation1 = client.operation(:Mutate)
mutate_operation2 = client.operation(:Mutate)
campaign_operation = client.operation(:Campaign)
ad_group_operation = client.operation(:AdGroup)
# Do some setup here to get campaign_operation and ad_group_operation into the
# state you would want them for a regular mutate call to their respective
# services.
mutate_operation1.campaign_operation = campaign_operation
mutate_operation2.ad_group_operation = ad_group_operation
google_ads_service.mutate(customer_id, [mutate_operation1, mutate_operation2])
Giống như các dịch vụ khác, điểm cuối này chỉ hỗ trợ một phần lỗi và chỉ xác thực.