Link product accounts

  • The Google Ads API allows linking Google Ads accounts to other product accounts.

  • Account linking can happen through either an invitation flow or a direct linking flow.

  • The invitation flow is used when you have administrator access to only the Google Ads account and involves sending or accepting an invitation.

  • The direct linking flow is used when you have administrator access to both accounts and allows for direct link creation.

  • Users of the deprecated AccountLinkService should migrate to ProductLinkService or continue using AccountLinkService based on the link type.

The Google Ads API supports linking Google Ads accounts to other product accounts. This guide explains how to use the API to link your accounts.

When linking a Google Ads account to another product account, there are two different ways in which the linking can happen.

Invitation flow

Use the invitation flow when you have administrator access to the Google Ads account, but not the product account. This flow works in two scenarios:

  1. You want to link the two accounts and create an invitation for an administrator of the product account. The product account administrator accepts the invitation to complete the account linking process.
  2. The product account administrator wants to link the two accounts, but doesn't have access to the Google Ads account. The product account administrator creates an invitation, and you accept the invitation and complete the linking process.

Use the following methods in this scenario:

Scenario Action Remarks
Scenario 1 Create an invitation Use the ProductLinkInvitationService.CreateProductLinkInvitation method to create an invitation. The status of the ProductLinkInvitation shouldn't be set; the Google Ads API server will set this to REQUESTED upon the successful completion of the API call. When creating an invitation for an Advertising Partner (AdvertisingPartnerLinkInvitationIdentifier), advertising_partner_properties.allowed_domain is required starting in v25 (and optional in v24 and earlier).
Inspect the status of an invitation Use GoogleAdsService.Search or GoogleAdsService.SearchStream to query the product_link_invitation resource and inspect its status.
Scenario 2 Retrieve an invitation Use GoogleAdsService.Search or GoogleAdsService.SearchStream to query the product_link_invitation resource. Filter for status = PENDING_APPROVAL to accept or reject a pending invitation.
Accept or reject an invitation Use the ProductLinkInvitationService.UpdateProductLinkInvitation method to update the status of the ProductLinkInvitation to ACCEPTED or REJECTED.
Revoke an invitation Use the ProductLinkInvitationService.RemoveProductLinkInvitation method to revoke an existing ProductLinkInvitation.

The following common errors can be thrown in this workflow:

Error code Explanation
ProductLinkInvitationError.PERMISSION_DENIED The customer doesn't have the permission to perform this action.
ProductLinkInvitationError.NO_INVITATION_REQUIRED An invitation couldn't be created, since the user already has administrator access to the invited account. The user should use the ProductLinkService to directly create an active link.

Direct linking flow

Use the direct linking flow when you have administrator access to both the Google Ads account and the product account. In this case, directly link the Google Ads account to the product account instead of sending an invitation.

Use the following methods in this scenario:

Action Remarks
Create an active link Use ProductLinkService.CreateProductLink to create a ProductLink.
Disable an active link Use ProductLinkService.RemoveProductLink to remove an active ProductLink.
Retrieve active links Use GoogleAdsService.Search or GoogleAdsService.SearchStream to query the product_link resource.

The following common errors may be thrown in this workflow:

Error code Explanation
ProductLinkError.CREATION_NOT_PERMITTED An account linking was attempted using the direct link flow, but this isn't supported due to lack of permissions. The user should use ProductLinkInvitationService to do the invitation flow instead.
ProductLinkError.INVITATION_EXISTS A link cannot be created because a pending invitation already exists.

You can retrieve all product links associated with your Google Ads account using a GAQL query against the product_link resource.

SELECT
  product_link.product_link_id,
  product_link.type
FROM product_link

The product_link.type field indicates the type of linked product or service. Depending on the type, other fields within the product_link resource will be populated, providing more details about the link. For example, if the type is DATA_PARTNER, the data_partner field will contain information about the linked data partner account.

This lets you obtain a list of external services and product accounts linked directly to your Google Ads account, such as Merchant Center, Google Ads, Advertising Partners, or data partners.

Changes to AccountLinkService

If you use AccountLinkService to link a Google Ads account to another product account, you must migrate your existing application to one of the workflows listed earlier. For the following link types, migrate off AccountLinkService and use ProductLinkService:

For ThirdPartyAppAnalyticsLinkIdentifier, continue to use AccountLinkService.