Service to return insights on marketing data.
This feature is only available to data partners. v1
Package
@google-ads/datamanagerConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);Construct an instance of MarketingDataInsightsServiceClient.
| Parameters | |
|---|---|
| Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
get apiEndpoint(): string;The DNS address for this API service.
apiEndpoint
static get apiEndpoint(): string;The DNS address for this API service - same as servicePath.
auth
auth: gax.GoogleAuth;descriptors
descriptors: Descriptors;innerApiCalls
innerApiCalls: {
[name: string]: Function;
};marketingDataInsightsServiceStub
marketingDataInsightsServiceStub?: Promise<{
[name: string]: Function;
}>;pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};port
static get port(): number;The port for this API service.
scopes
static get scopes(): string[];The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;The DNS address for this API service.
universeDomain
get universeDomain(): string;warn
warn: (code: string, message: string, warnType?: string) => void;Methods
close()
close(): Promise<void>;Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
| Returns | |
|---|---|
| Type | Description |
Promise<void> |
{Promise} A promise that resolves when the client is closed. |
getProjectId()
getProjectId(): Promise<string>;| Returns | |
|---|---|
| Type | Description |
Promise<string> |
|
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;| Parameter | |
|---|---|
| Name | Description |
callback |
Callback<string, undefined, undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
| Returns | |
|---|---|
| Type | Description |
Promise<{
[name: string]: Function;
}> |
{Promise} A promise that resolves to an authenticated service stub. |
matchAccountFromPartnerLinkName(partnerLinkName)
matchAccountFromPartnerLinkName(partnerLinkName: string): string | number;Parse the account from PartnerLink resource.
| Parameter | |
|---|---|
| Name | Description |
partnerLinkName |
string
A fully-qualified path representing PartnerLink resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromUserListDirectLicenseName(userListDirectLicenseName)
matchAccountFromUserListDirectLicenseName(userListDirectLicenseName: string): string | number;Parse the account from UserListDirectLicense resource.
| Parameter | |
|---|---|
| Name | Description |
userListDirectLicenseName |
string
A fully-qualified path representing UserListDirectLicense resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName)
matchAccountFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string): string | number;Parse the account from UserListGlobalLicenseCustomerInfo resource.
| Parameter | |
|---|---|
| Name | Description |
userListGlobalLicenseCustomerInfoName |
string
A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromUserListGlobalLicenseName(userListGlobalLicenseName)
matchAccountFromUserListGlobalLicenseName(userListGlobalLicenseName: string): string | number;Parse the account from UserListGlobalLicense resource.
| Parameter | |
|---|---|
| Name | Description |
userListGlobalLicenseName |
string
A fully-qualified path representing UserListGlobalLicense resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromUserListName(userListName)
matchAccountFromUserListName(userListName: string): string | number;Parse the account from UserList resource.
| Parameter | |
|---|---|
| Name | Description |
userListName |
string
A fully-qualified path representing UserList resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the account. |
matchAccountTypeFromPartnerLinkName(partnerLinkName)
matchAccountTypeFromPartnerLinkName(partnerLinkName: string): string | number;Parse the account_type from PartnerLink resource.
| Parameter | |
|---|---|
| Name | Description |
partnerLinkName |
string
A fully-qualified path representing PartnerLink resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the account_type. |
matchAccountTypeFromUserListDirectLicenseName(userListDirectLicenseName)
matchAccountTypeFromUserListDirectLicenseName(userListDirectLicenseName: string): string | number;Parse the account_type from UserListDirectLicense resource.
| Parameter | |
|---|---|
| Name | Description |
userListDirectLicenseName |
string
A fully-qualified path representing UserListDirectLicense resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the account_type. |
matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName)
matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string): string | number;Parse the account_type from UserListGlobalLicenseCustomerInfo resource.
| Parameter | |
|---|---|
| Name | Description |
userListGlobalLicenseCustomerInfoName |
string
A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the account_type. |
matchAccountTypeFromUserListGlobalLicenseName(userListGlobalLicenseName)
matchAccountTypeFromUserListGlobalLicenseName(userListGlobalLicenseName: string): string | number;Parse the account_type from UserListGlobalLicense resource.
| Parameter | |
|---|---|
| Name | Description |
userListGlobalLicenseName |
string
A fully-qualified path representing UserListGlobalLicense resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the account_type. |
matchAccountTypeFromUserListName(userListName)
matchAccountTypeFromUserListName(userListName: string): string | number;Parse the account_type from UserList resource.
| Parameter | |
|---|---|
| Name | Description |
userListName |
string
A fully-qualified path representing UserList resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the account_type. |
matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName)
matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string): string | number;Parse the license_customer_info from UserListGlobalLicenseCustomerInfo resource.
| Parameter | |
|---|---|
| Name | Description |
userListGlobalLicenseCustomerInfoName |
string
A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the license_customer_info. |
matchPartnerLinkFromPartnerLinkName(partnerLinkName)
matchPartnerLinkFromPartnerLinkName(partnerLinkName: string): string | number;Parse the partner_link from PartnerLink resource.
| Parameter | |
|---|---|
| Name | Description |
partnerLinkName |
string
A fully-qualified path representing PartnerLink resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the partner_link. |
matchUserListDirectLicenseFromUserListDirectLicenseName(userListDirectLicenseName)
matchUserListDirectLicenseFromUserListDirectLicenseName(userListDirectLicenseName: string): string | number;Parse the user_list_direct_license from UserListDirectLicense resource.
| Parameter | |
|---|---|
| Name | Description |
userListDirectLicenseName |
string
A fully-qualified path representing UserListDirectLicense resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the user_list_direct_license. |
matchUserListFromUserListName(userListName)
matchUserListFromUserListName(userListName: string): string | number;Parse the user_list from UserList resource.
| Parameter | |
|---|---|
| Name | Description |
userListName |
string
A fully-qualified path representing UserList resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the user_list. |
matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName)
matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string): string | number;Parse the user_list_global_license from UserListGlobalLicenseCustomerInfo resource.
| Parameter | |
|---|---|
| Name | Description |
userListGlobalLicenseCustomerInfoName |
string
A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the user_list_global_license. |
matchUserListGlobalLicenseFromUserListGlobalLicenseName(userListGlobalLicenseName)
matchUserListGlobalLicenseFromUserListGlobalLicenseName(userListGlobalLicenseName: string): string | number;Parse the user_list_global_license from UserListGlobalLicense resource.
| Parameter | |
|---|---|
| Name | Description |
userListGlobalLicenseName |
string
A fully-qualified path representing UserListGlobalLicense resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the user_list_global_license. |
partnerLinkPath(accountType, account, partnerLink)
partnerLinkPath(accountType: string, account: string, partnerLink: string): string;Return a fully-qualified partnerLink resource name string.
| Parameters | |
|---|---|
| Name | Description |
accountType |
string
|
account |
string
|
partnerLink |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
retrieveInsights(request, options)
retrieveInsights(request?: protos.google.ads.datamanager.v1.IRetrieveInsightsRequest, options?: CallOptions): Promise<[
protos.google.ads.datamanager.v1.IRetrieveInsightsResponse,
protos.google.ads.datamanager.v1.IRetrieveInsightsRequest | undefined,
{} | undefined
]>;Retrieves marketing data insights for a given user list.
This feature is only available to data partners.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
* login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId} * linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
| Parameters | |
|---|---|
| Name | Description |
request |
IRetrieveInsightsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.ads.datamanager.v1.IRetrieveInsightsResponse,
protos.google.ads.datamanager.v1.IRetrieveInsightsRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent account that owns the user list.
* Format: `accountTypes/{account_type}/accounts/{account}`
*/
// const parent = 'abc123'
/**
* Required. Baseline for the insights requested.
*/
// const baseline = {}
/**
* Required. The user list ID for which insights are requested.
*/
// const userListId = 'abc123'
// Imports the Datamanager library
const {MarketingDataInsightsServiceClient} = require('@google-ads/datamanager').v1;
// Instantiates a client
const datamanagerClient = new MarketingDataInsightsServiceClient();
async function callRetrieveInsights() {
// Construct request
const request = {
parent,
baseline,
userListId,
};
// Run request
const response = await datamanagerClient.retrieveInsights(request);
console.log(response);
}
callRetrieveInsights();
retrieveInsights(request, options, callback)
retrieveInsights(request: protos.google.ads.datamanager.v1.IRetrieveInsightsRequest, options: CallOptions, callback: Callback<protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, protos.google.ads.datamanager.v1.IRetrieveInsightsRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IRetrieveInsightsRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, protos.google.ads.datamanager.v1.IRetrieveInsightsRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
retrieveInsights(request, callback)
retrieveInsights(request: protos.google.ads.datamanager.v1.IRetrieveInsightsRequest, callback: Callback<protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, protos.google.ads.datamanager.v1.IRetrieveInsightsRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IRetrieveInsightsRequest
|
callback |
Callback<protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, protos.google.ads.datamanager.v1.IRetrieveInsightsRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
userListDirectLicensePath(accountType, account, userListDirectLicense)
userListDirectLicensePath(accountType: string, account: string, userListDirectLicense: string): string;Return a fully-qualified userListDirectLicense resource name string.
| Parameters | |
|---|---|
| Name | Description |
accountType |
string
|
account |
string
|
userListDirectLicense |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
userListGlobalLicenseCustomerInfoPath(accountType, account, userListGlobalLicense, licenseCustomerInfo)
userListGlobalLicenseCustomerInfoPath(accountType: string, account: string, userListGlobalLicense: string, licenseCustomerInfo: string): string;Return a fully-qualified userListGlobalLicenseCustomerInfo resource name string.
| Parameters | |
|---|---|
| Name | Description |
accountType |
string
|
account |
string
|
userListGlobalLicense |
string
|
licenseCustomerInfo |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
userListGlobalLicensePath(accountType, account, userListGlobalLicense)
userListGlobalLicensePath(accountType: string, account: string, userListGlobalLicense: string): string;Return a fully-qualified userListGlobalLicense resource name string.
| Parameters | |
|---|---|
| Name | Description |
accountType |
string
|
account |
string
|
userListGlobalLicense |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
userListPath(accountType, account, userList)
userListPath(accountType: string, account: string, userList: string): string;Return a fully-qualified userList resource name string.
| Parameters | |
|---|---|
| Name | Description |
accountType |
string
|
account |
string
|
userList |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |