Before you can create a Shopping campaign, you need to first link your Google Ads account to your Google Merchant Center account as follows:
- Send a link request from your Merchant Center account to your Google Ads account.
- Approve the link request in your Google Ads account.
Sending link requests from your Merchant Center account
There are two ways of sending a link request:
- Use the Merchant Center web interface to send a link request.
- Use the Content API for Shopping to
update the
adsLinks
of yourAccount
.
Managing link requests in your Google Ads account
You can change the status of Merchant Center links in your Google Ads account by using the Google Ads web interface to approve or reject an invitation. You can also update invitations or remove existing links using the Google Ads API as explained below.
List all Merchant Center invitations
You can run a Google Ads API report using the following GAQL query to retrieve a list of all pending invitations to link a Google Ads customer ID to a Merchant Center account.
SELECT
product_link_invitation.merchant_center.merchant_center_id,
product_link_invitation.type
FROM product_link_invitation
WHERE product_link_invitation.status = 'PENDING_APPROVAL'
AND product_link_invitation.type = 'MERCHANT_CENTER'
To retrieve all invitations, remove the filtering condition for the
product_link_invitation.status
field in the query above.
Accept an invitation
You can approve the link by setting the product_link_invitation
status to
ACCEPTED
.
Construct an
UpdateProductLinkInvitationRequest
object and set thecustomer_id
field as the Google Ads customer ID.Set the
resource_name
field as the resource name of theproduct_link_invitation
.Set the
product_link_invitation_status
toACCEPTED
.Issue an
UpdateProductLinkInvitation
API call.
If the invitation flow is attempted by a user who is already an
administrator on both accounts, then a
NO_INVITATION_REQUIRED
error is thrown. You can check for this error and fall back to the direct
link flow in such cases.
Reject an invitation
Rejecting an invitation is similar to accepting an
invitation except that the
product_link_invitation_status
field is set to REJECTED
. If an invitation is rejected, it remains in the
REJECTED
state and cannot be accepted. You must then create a new
invitation if required.
Direct linking without invitation
If the user attempting to link the Google Ads account to the Merchant Center account is an administrator on both accounts, then you can bypass the invitation step and link both accounts directly using the Google Ads API.
Construct a
CreateProductLinkRequest
object and set thecustomer_id
field as the Google Ads customer ID.Create a new
ProductLink
object and set itsmerchant_center_id
field to the ID of the Merchant Center account.Set the
ProductLink
to theproduct_link
field of the request object.Issue a
CreateProductLink
API call.
If direct linking is attempted by a user who doesn't have sufficient
permissions, then a
CREATION_NOT_PERMITTED
error is thrown. You can check for this error and fall back to the
invitation flow in such cases.
List all Merchant Center links
You can run a Google Ads API report using the following GAQL query to retrieve a list of links for a Google Ads customer ID.
SELECT
product_link.merchant_center.merchant_center_id,
product_link.product_link_id
FROM product_link
WHERE product_link.type = 'MERCHANT_CENTER'
Unlink a link
Take the following steps to unlink a link:
Construct a
RemoveProductLinkRequest
object and set thecustomer_id
field as the Google Ads customer ID.Set the
resource_name
as the resource name of theproduct_link
.Issue a
RemoveProductLink
API call.
Business Manager
Business Manager is a unified representation of a business on Google. When you manage both your Google Ads account and your Merchant Center accounts using a Business Manager account, Business Manager automatically creates links between your Google Ads account and the Merchant Center account. You can retrieve these links using the Google Ads API, but these links cannot be mutated with the Google Ads API.