4.4.2 • Published 18 days ago

@google-cloud/gmp-googleads-connector v4.4.2

Weekly downloads
52
License
Apache-2.0
Repository
github
Last release
18 days ago

GMP and Google Ads Connector

Disclaimer: This is not an official Google product.

GMP and Google Ads Connector (code name Tentacles) is an out-of-box solution based on Google Cloud Platform. It can send a massive amount data to GMP (e.g. Google Analytics, Campaign Manager) or Google Ads in an automatic and reliable way.

Contents

1. Key Concepts

1.1. Challenges for sending data to APIs

  1. Different APIs have different idioms, authentication and QPS.
  2. Sending out big data is a long process with some APIs' QPS limitations.
  3. Maintaining the reliability of a long process brings extra complexity.

1.2. Solution architecture overview

 ▉▉▉        trigger         ▒ ▒ ▒ ▒ ▒ ▒
═════> (gcs) ──────> [init] ═══════════════> {ps-data}
 File                  |    Slice & publish      ║
                       |    data messages        ║ ▒
               Publish |                         ║     Pull one message
              'nudge'  └---> {ps-tran} ──────> [tran]  from the queue and
               message          ^      trigger   ║     pass it to the next
                                │                ║ ▒
LEGEND                          │                V        ▒               ▒
(..): Cloud Storage             │             {ps-api} ══════> [api] ▸▹▸▹▸▹▸▹▸▹ GMP/Google Ads
[..]: Cloud Functions           │                      trigger   |   Send out
{..}: Cloud Pub/Sub Topic       └--------------------------------┘   requests
▉/▒ : Data/Data piece                 Publish 'nudge' message
==> : Data flow
──> : Event flow
- ->: Publish 'nudge' message

Components' description:

ComponentsGCP ProductDescription
(gcs)Cloud StorageNew files will automatically trigger Cloud Functions [initiator] to start the whole process.
[init]iatorCloud FunctionsTriggered by (gcs), it validates the file first. Then it slices and publishes the data as messages to {ps-data}. After that, it sends a nudge message to {ps-tran}.
{ps-data}Cloud Pub/SubThis message queue will hold the data from incoming files. It only has pull subscriptions. So all data will be held here until taken away intendedly.
{ps-tran}Cloud Pub/SubThis topic triggers Cloud Functions [transporter] which manages the pull subscription of {ps-data}.
[tran]sporterCloud FunctionsTriggered by new messages to {ps-tran}, it will pull one message from {ps-data} and publish to {ps-api}.
{ps-api}Cloud Pub/SubTrigger source for the Cloud Functions [apirequester]. It will pass the data from [transporter] to [apirequester].
[api]requesterCloud FunctionsTriggered by {ps-api}, it sends the data to the corresponding API endpoint with proper configuration based on the incoming file name.

1.3. Summary

  1. Cloud Functions initiator, transporter and Cloud Pub/Sub topics ps-data, ps-tran, ps-api altogether compose a serverless system that can hold big data while offering pieces of data in an on-demand way. This system is unrelated to APIs1.

  2. Cloud Functions apirequester is a single purpose function to send out a small piece of data to the given target (backend of the API). It maintains the feasibility to extend for new APIs.

1: Actually, every API has its own ps-data topic which will be created during installation.

2. Installation


NOTE: The new Google Sheets based tool now is available. Users are encouraged to using that tool to install, upgrade or manage Tentacles. For more details, see Install Tentacles in a Google Sheets based tool

The following content in Chapter 2 Installation is kept here for reference.

2.1. Create/use a Google Cloud Project(GCP) with a billing account

  1. How to Creating and Managing Projects
  2. How to Create, Modify, or Close Your Billing Account

2.2. Check the permissions

Parts of Cloud Project permissions are required to install this solution. Usually, a user with the Editor role can do the installation except the 'dashboard' part. If more precise permissions are preferred, the user may need following roles:

  • Storage Admin
  • Pub/Sub Editor
  • Cloud Functions Developer
  • Cloud Datastore User
  • Service Account User (to activate the default service account for Cloud Functions)
  • Service Usage Admin (to activate APIs)

If the dashboard is enabled, then following roles are required, too.

  • Logs Configuration Writer
  • Project IAM Admin
  • BigQuery Data Editor
  • Logs Writer

Note: Role 'Project Editor' doesn't contain the permissions in the following two roles: Logs Configuration Writer and Project IAM Admin.

During the installation, the script will check whether the current user has enough permissions to continue. It would be more smooth if you can check the permissions before start installation.

2.3. Check out source codes

  1. Open the Cloud Shell
  2. Clone the repository:
git clone https://github.com/GoogleCloudPlatform/cloud-for-marketing.git

2.4. Run install script

Run the installation script and follow the instructions:

cd cloud-for-marketing/marketing-analytics/activation/gmp-googleads-connector; bash deploy.sh

During the installation process, the script will do following:

  1. Enable Google Cloud Components and Google APIs
  2. If there is no Firestore instance, guide users to initialize Firestore.
    • Note: Whenever the location or mode of Firestore is confirmed, neither could be changed again in this project. So be cautious when make decision of this.
    • Initialization Firestore requires Owner access.
    • Initialization can be done on Cloud Console(GUI) as well.
  3. Create or use an existent Storage bucket for coming file
  4. Create Topics and Subscriptions of Pub/Sub
  5. If necessary (see Accounts in external systems), it will guide users to complete an OAuth authorization process and save the refresh token.
  6. Deploy Cloud Functions of Tentacles
  7. If the dashboard is enabled, it will create a Log Router to send specific logs to BigQuery and create several Views in BigQuery as the data sources in the dashboard.

3. Post Installation

3.1. Accounts in external systems

API integration is not a single side effort. Besides installing Tentacles, the user needs to get the API server side and the data both ready.

Note: this chapter will cover these topics in a general way. Please refer every API's chapter for the details.

Besides the Google Analytics Measurement Protocol or SFTP uploading, most of the APIs need its own 'accounts' to manage the access. For example, we need to have an 'account' in Google Analytics before we can use Data Import to upload file into Google Analytics.

There are two authorization methods: Service Account and OAuth:

  • Tentacles will let the user to choose, though Service Account is preferred.
  • If an API only supports OAuth (e.g. Google Ads API) is enabled, then the method would just be OAuth no matter whether there is any enabled APIs that can support Service Account.
  • For OAuth, the user account grants the access should have the proper access in the target systems.
  • For Service Account, the user needs to use the email of the service account of the Cloud Functions to create 'accounts' in target systems and grant them with proper access.

Tip: If you don't know the email of the service account, run the following script: bash deploy.sh print_service_account.

3.2. Configurations of APIs

Different APIs have different configurations, as well as one API could have more than one configurations for different usages, e.g. Google Analytics Data Import can have multiple uploaded datasets. Hence, configurations are grouped by APIs and combine a single JSON object in the file config_api.json.

Following is a sample config that contains a configuration item named foo for Google Analytics Data Import and another one named bar for Measurement Protocol.

{
  "GA": {
    "foo": {
      "dataImportHeader": "[YOUR-DATA-IMPORT-HEADER]",
      "gaConfig": {
        "accountId": "[YOUR-GA-ACCOUNT-ID]",
        "webPropertyId": "[YOUR-WEB-PROPERTY-ID]",
        "customDataSourceId": "[YOUR-CUSTOM-DATASOURCE-ID]"
      }
    }
  },
  "MP": {
    "bar": {
      "mpConfig": {
        "v": "1",
        "t": "transaction",
        "ni": "1",
        "dl": "[YOUR-SOMETHING-URL]",
        "tid": "[YOUR-WEB-PROPERTY-ID]"
      }
    }
  }
}

After editing the content in config_api.json, run following script to synchronize the configuration to Google Cloud Firestore/Datastore. Tentacles will pick up the latest configuration automatically.

bash deploy.sh update_api_config

3.3. Name convention of data files

After deployment, Tentacles will monitor all the files in the Storage bucket. Tentacles isn't designed for a fixed API or configurations. On the contrary, it is easy to extend for new APIs or configurations. To achieve that, Tentacles expects the incoming data filenames contain the pattern API{X} and config{Y}.

  • X stands for the API code, currently available values:

    • MP: Google Analytics Measurement Protocol
    • GA: Google Analytics Data Import
    • CM: DCM/DFA Reporting and Trafficking API to upload offline conversions
    • SFTP: SFTP upload
    • GS: Load a CSV into a Google Sheets
    • SA: Search Ads 360 conversions insert
    • ACLC: Google Ads Click Conversion Upload via API
    • ACM: Google Ads Customer Match upload
    • MP_GA4: Measurement Protocol Google Analytics 4
    • ACA: Google Ads Conversion Adjustments upload via API
    • AOUD: Google Ads Offline User Data Upload (OfflineUserDataJobService)
  • Y stands for the config name, e.g. foo or bar in the previous case.

Other optional patterns in filename:

  • If the filename contains dryrun, then the whole process will be carried out besides that the data won't be really sent to the API server.

  • If the filename contains _size{Z} or _size{Zmb}, the incoming file will be divided into multiple files with the size under ZMB in Cloud Storage. For some APIs, Tentacles will use files in Cloud Storage to transfer the data instead of the Pub/Sub. (The reason is for those 'file uploading' types of APIs, using file directly is more efficient.) In that case, this setting will make sure the files won't oversize the target systems' capacity.

  • If the filename contains appended{}, Tentacles will take the string in the braces (included) as a JSON string and parse it into a parameter object. The parameters will be replaced those placeholders ${parameter} in the configuration.

Note: Previous square brackets as the file name marker (e.g. APIX) is also supported, though it is not convenient to copy those files through gsutil.

3.4. Content of data files

For most APIs data, Tentacles expects the data format as JSONL(newline-delimited JSON). Every line is a valid JSON string. This is one of the BigQuery export format.

There are three exceptions:

  1. SFTP: This API will upload the given file to the server through SFTP no matter what the format of files is.
  2. GA: Google Analytics Data Import only supports CSV files.
  3. GS: Loading a CSV into a Google Sheets also expects CSV files.

3.5. Set up the dashboard

If the dashboard feature is enabled during the installation, a Log Router Sink will be created to send related information of how Tentacles process files to BigQuery. Later, a Data Studio dashboard can be connected to the BigQuery to offer visualized results.

Follow these steps to get the dashboard ready:

  1. Join the Tentacles External Users group and wait for approval.
  2. After you joined the group, you can visit the dashboard template.
  3. Click button Edit and Share then Copy Report to create your own copy.
  4. In the Data Studio copied dashboard, use menu Resource - Manage added data sources to reconnect those data sources to your BigQuery. For more details, see this tutorial.

4. API Details

4.1. MP: Google Analytics Measurement Protocol

API SpecificationValue
API CodeMP
Data FormatJSONL
What Tentacles doesMerging the data with the configuration to build the hit URLs and send them to Google Analytics.
Usage ScenariosUploading offline conversions
Transfer Data onPub/Sub
Authorization ModeNo Authorization required
Role in target systemN/A
Request TypeHTTP Post
# Records per request20
QPS-
ReferenceMeasurement Protocol Overview
  • Sample configuration piece:
{
  "qps": 10,
  "numberOfThreads": 10,
  "debug": true,
  "mpConfig": {
    "v": "1",
    "t": "transaction",
    "ni": "1",
    "dl": "[YOUR-SOMETHING-URL]",
    "tid": "[YOUR-WEB-PROPERTY-ID]"
  }
}
  • Fields' definition:
    • qps, numberOfThreads and debug optional.
    • qps, numberOfThreads are used to control the sending speed. qps is the 'queries per second' and numberOfThreads stands for how many requests will be sent simultaneously.
    • If debug (default value false) is set as true, Tentacles will NOT send hits to Google Analytics server, instead the hits will be send to Measurement Protocol Validation Server to get validation messages. Errors will be shown in the dashboard. You can use this setting to debug and switch if back to false when the validation is ok.
    • All these properties names in configuration mpConfig or data file can be found in Measurement Protocol Parameter Reference.
  • Sample Data file content:
{"cid": "1471305204.1541378885", "ti": "123", "tr": "100"}

4.2. GA: Google Analytics Data Import

API SpecificationValue
API CodeGA
Data FormatCSV
What Tentacles doesUsing the GA data import configuration to upload the file directly.
Usage ScenariosUpload user segment information from prediction results of Machine Learning models or CRM
Transfer Data onCloud Storage
Authorization ModeService Account / OAuth
Role in target systemService Account's email or OAuth account as the Editor
Request TypeFile upload based on GA API Client Library
# Records per requests- / The maximum of single file size is 1GB
QPS-
ReferenceCustom Data import example
  • Sample configuration piece:
{
  "secretName":"[YOUR-OAUTH-SECRET-NAME]",
  "dataImportHeader": "[YOUR-DATA-IMPORT-HEADER]",
  "gaConfig": {
    "accountId": "[YOUR-GA-ACCOUNT-ID]",
    "webPropertyId": "[YOUR-WEB-PROPERTY-ID]",
    "customDataSourceId": "[YOUR-CUSTOM-DATASOURCE-ID]"
  },
  "clearOption": {
    "max": 20,
    "ttl": 14
  }
}
  • Fields' definition:

    • secretName is the name of Secret Manager
    • dataImportHeader is the header of uploading a CSV file. It is fixed in Google Analytics when the user set up the Data Import item, and it must exist in the file uploaded.
      • Sometimes, the data files do not have such a header line, e.g. BigQuery cannot export data with semicolons in column names. In that case, an explicit config item dataImportHeader is required, just like this sample. Tentacles will automatically attach this line at the beginning of the data file before uploading.
    • gaConfig is the configuration for a data import item. It has:
      • accountId Google Analytics Account Id associated with the upload.
      • webPropertyId Web property UA-string associated with the upload.
      • customDataSourceId Custom data source Id to which the data being uploaded belongs.
    • clearOption configuration to remove previously uploaded data files:
      • ttl Before this uploading, files exist longer than this number of days will be removed.
      • max Before this uploading, only max files will be kept others will be deleted chronologically.
      • Note: ttl and max are optional. If they exist at the same time, then they will both effect, which means for all the uploaded files, only keep those latest, no longer than ttl days, up to max files.
  • Sample Data file content:

395040310.1546495163,NO
391813229.1541728717,YES
1277688775.1563499908,YES
1471305204.1541378885,NO

4.3. CM: Campaign Manager 360 insert/update offline conversions

API SpecificationValue
API CodeCM
Data FormatJSONL
What Tentacles doesCombined the data with the configuration to build the request body and send them to the CM API endpoint.
Usage Scenarios1. Personalizing Ads via user variables in conversions; 2. Uploading verified(offline process) purchases as the real transactions to let CM do the optimization based on better data.
Transfer Data onPub/Sub
Authorization ModeService Account / OAuth
Role in target systemCreate a User Profile for the Service Account's email or OAuth account with a role that has the Insert offline conversion permission
Request TypeHTTP Request to RESTful endpoint
# Records per request1,000
QPS1
ReferenceOverview: Campaign Manager 360 API's Conversions service
  • Sample configuration piece:
{
  "cmAccountId": "[YOUR-DCM-ACCOUNT-ID]",
  "cmConfig": {
    "idType": "encryptedUserId",
    "operation": "insert|update|undefined",
    "conversion": {
      "floodlightConfigurationId": "[YOUR-FL-CONFIG-ID]",
      "floodlightActivityId": "[YOUR-FL-ACTIVITY-ID]",
      "quantity": 1,
      "ordinal": "[UNIX_EPOCH]"
    },
    "customVariables": ["U2"],
    "encryptionInfo": {
      "encryptionEntityId": "[YOUR-ENCRYPTION-ID]",
      "encryptionEntityType": "DCM_ADVERTISER",
      "encryptionSource": "AD_SERVING"
    }
  }
}
  • Fields' definition:
    • idType, value can be: encryptedUserId, gclid, matchId or mobileDeviceId.
      • encryptedUserId, a single encrypted user ID obtained from the %m match macro or Data Transfer.
      • gclid, a Google Click Identifier generated by Google Ads or Search Ads 360.
      • matchId, A unique advertiser created identifier passed to Campaign Manager 360 via a Floodlight tag.
      • mobileDeviceId, an unencrypted mobile ID in the IDFA or AdID format.
    • operation, optional, values can be insert or update. This setting determines the conversions to be inserted or updated. If this is not specified, it will be taken as insert.
    • conversion, common properties for a conversion, e.g. floodlight info.
      • quantity, the quantity of the conversion. This is a required field.
    • customVariables, an array of user variable names. It can be omitted if not required.
    • encryptionInfo, only required as the idType is encryptedUserId

Note:

  • Campaign Manager offline conversions can be attributed to a click, a device, or a user ID. For each request, there should be one and only one attribution type. That's defined by idType.
  • By default, the ordinal is set to the run-time Unix epoch timestamp. For more information on how the ordinal is used for conversion de-duplication, see the FAQ.

Tip: For more details of a request, see Upload conversions

  • Sample Data file content:

Attributed to a Google Click Identifier (gclid):

{"gclid": "EAIaIQobChMI3_fTu6O4xxxPwEgEAAYASAAEgK5VPD_example", "timestampMicros": "1550407680000000"}

Attributed to encrypted user ID (encryptedUserId):

{"encryptedUserId": "EAIaIQobChMI3_fTu6O4xxxPwEgEAAYASAAEgK5VPD_example", "U2": "a|b|c"}

Conversions with UserIdentifier:

{"gclid": "EAIaIQobChMI3_fTu6O4xxxPwEgEAAYASAAEgK5VPD_example", "timestampMicros": "1550407680000000", "userIdentifiers": {"hashedEmail": "9de762fd8f832878b46feb58a6a79d80c013199315a4ee3b86b41a602f8fc3a7"}}

4.4. SFTP: Business Data upload to Search Ads 360

API SpecificationValue
API CodeSFTP
Data Formatany
What Tentacles doesConnect the SFTP server and upload the file
Usage ScenariosUploading Business Data feed file for Search Ads 360.
Transfer Data onGCS
Authorization ModeSpecific user/password of SFTP server.
Role in target systemN/A
Request TypeSFTP file transfer
# Records per request-
QPS-
Reference-

Note: Though SFTP is a general purpose file transfer protocol, Tentacles supports this mainly for Search Ads 360 Business Data upload. For more information, see Introduction to business data in Search Ads 360.

  • Sample configuration piece:
{
  "fileName": "[FILENAME_YOU_WANTED_TO_SFTP]",
  "sftp": {
    "host": "[YOUR-SFTP-HOST]",
    "port": "[YOUR-SFTP-PORT]",
    "username": "[YOUR-SFTP-USERNAME]",
    "password": "[YOUR-SFTP-PASSWORD]"
  }
}

Tip: Optional fileName is used to give the uploaded file a fixed name. It supports TIMESTAMP as a placeholder for an uploading timestamp string value. \ If fileName is omitted, a default file name based on the ingested one will be generated.

  • Sample Data file content:

It could be any file.

4.5. GS: Google Ads conversions/store-sales scheduled uploads based on Google Sheets

API SpecificationValue
API CodeGS
Data FormatCSV
What Tentacles doesLoad the data from the CSV to the given SpreadSheet through Google Sheets API.
Usage ScenariosFor non Google Ads API clients:1. Import conversions from ad clicks2. Import store sales data
Transfer Data onGCS
Authorization ModeService Account / OAuth
Role in target systemService Account's email or OAuth account as the Editor of the Google Sheets
Request TypeHTTP Request to RESTful endpoint
# Records per request-
QPS-
ReferenceImport conversions from ad clicks into Google AdsGoogle Sheets API

Google Sheets API can be used to read, write, and format data in Sheets. Google Ads supports to use a Google Sheet as the data source of scheduled uploads of conversions. The extra benefit is this integration does not require a Google Ads Developer Token.

Note: Google Sheets has a limit of 10,000,000 cells for a single SpreadSheet. If every conversion needs 5 properties/columns/fields, then for a single Spreadsheet data source, there could be about 2 million conversions supported.

  • Sample configuration piece:
{
  "spreadsheetId": "[YOUR-SPREADSHEET-ID]",
  "sheetName": "[YOUR-SHEET-NAME]",
  "sheetHeader": "[ANYTHING-PUT-AHEAD-OF-CSV]",
  "pasteData": {
    "coordinate": {
      "rowIndex": 0,
      "columnIndex": 0
    },
    "type": "PASTE_NORMAL",
    "delimiter": ","
  }
}
  • Fields' definition:
    • spreadsheetId, the Spreadsheet ID.
    • sheetName, the name of the sheet that will load CSV data.
    • sheetHeader, fixed row(s) at the top of the Sheet before the CSV data. This is optional.
    • pasteData, PasteDataRequest for Sheets API batchUpdate.
  • Sample Data file content:
Google_Click_ID,Conversion_Name,Conversion_Time,Conversion_Value,Conversion_Currency
EAIaIQobChMIrLGCr66x4wIVVeh3Ch2eygjsEAAYASAAEgIFAKE_BwE,foo,2019-07-13 00:02:00,1,USD
EAIaIQobChMIvdTVjayx4wIV0eF3Ch0eGQAQEAAYBCAAEgIFAKE_BwE,foo,2019-07-13 00:04:00,1,USD
EAIaIQobChMI8rrrq62x4wIVQbDtCh2D3QU0EAAYAiAAEgIFAKE_BwE,foo,2019-07-13 00:01:00,1,USD

4.6. SA: Search Ads 360 conversions insert

API SpecificationValue
API CodeSA
Data FormatJSONL
What Tentacles doesCombined the data with the configuration to build the request body and sent them to SA360 API endpoint. If the data file is empty, then a updateAvailability request is sent out instead.
Usage ScenariosImport conversions from ad clicks into Search Ads.
Transfer Data onPub/Sub
Authorization MethodService Account / OAuth
Role in target systemCreate a User Profile for the Service Account's email or OAuth account with a role that has the Insert offline conversion permission
Request TypeHTTP Request to RESTful endpoint
# Records per request200
QPS10
ReferenceSearch Ads 360 API > Conversion: insert
  • Sample configuration piece:
{
  "saConfig": {
    "type": "TRANSACTION",
    "segmentationType": "FLOODLIGHT",
    "segmentationId": "[YOUR-SEGMENTATION-ID]",
    "state": "ACTIVE"
  },
  "availabilities": [
    {
      "agencyId": "[YOUR-AGENCY-ID]",
      "advertiserId": "[YOUR-ADVERTISER-ID]",
      "segmentationType": "FLOODLIGHT",
      "segmentationId": "[YOUR-SEGMENTATION-ID]"
    }
  ]
}
  • Fields' definition:

    • saConfig, the configuration for conversions
      • type, the type of the conversion, ACTION or TRANSACTION.
      • segmentationType, the segmentation type of this conversion (for example, FLOODLIGHT).
      • segmentationId, the numeric segmentation identifier (for example, DoubleClick Search Floodlight activity ID).
      • state, the state of the conversion, ACTIVE or REMOVED.
    • availabilities, the configuration for updating availabilities.
      • agencyId, agency Id.
      • advertiserId, advertiser Id.
      • segmentationType, the segmentation type that this availability is for (its default value is FLOODLIGHT).
      • segmentationId, the numeric segmentation identifier.
  • Sample Data file content:

{"clickId":"Cj0KCQjwiILsBRCGARIsAHK","conversionTimestamp":"1568766602000","revenueMicros":"1571066"}

4.7. ACLC: Google Ads Click Conversions upload via API

API SpecificationValue
API CodeACLC
Data FormatJSONL
What Tentacles doesCombined the data with the configuration to build the request body and sent them to Google Ads API endpoint.
Usage ScenariosUploading offline sales and other valuable actions to target and optimize your campaigns for increased profit based on better data.
Transfer Data onPub/Sub
Authorization MethodOAuth
Role in target systemThe user should at least has 'Standard' access.
Request TypeHTTP Request to RESTful endpoint
# Records per request2,000
QPS-
ReferenceOverview: Offline Conversion Imports
  • Sample configuration piece:
{
  "customerId": "[YOUR-GOOGLE-ADS-ACCOUNT-ID]",
  "loginCustomerId": "[YOUR-LOGIN-GOOGLE-ADS-ACCOUNT-ID]",
  "developerToken": "[YOUR-GOOGLE-ADS-DEV-TOKEN]",
  "debug": false,
  "adsConfig": {
    "conversionAction": "[YOUR-CONVERSION-ACTION-NAME]",
    "conversionValue": "[YOUR-CONVERSION-VALUE]",
    "currencyCode": "[YOUR-CURRENCY-CODE]",
    "userIdentifierSource": "[USER_IDENTIFIER_SOURCE]",
    "customVariableTags": "[YOUR-CUSTOM-VARIABLE-TAGS]",
    "consent": {
      "adUserData": "GRANTED|DENIED|undefined",
      "adPersonalization": "GRANTED|DENIED|undefined"
    }
  }
}
  • Fields' definition:
    • customerId, Google Ads Customer account Id.
    • loginCustomerId, Login customer account Id (MCC Account Id).
    • developerToken, Developer token to access the API.
    • debug, optional, default value is false. If it's set as true, the request is validated but not executed. Only errors are returned.
    • adsConfig, configuration items for click conversions:
      • conversionAction, Resource name of the conversion action in the format customers/${customerId}/conversionActions/${conversionActionId}.
      • conversionValue, The default value of the conversion for the advertiser
      • currencyCode, The default currency associated with conversion value; ISO 4217 3 character currency code e.g. EUR, USD.
      • userIdentifierSource: If you uploaded user identifiers in the conversions, you need to specify the source.
      • customVariableTags: An array of custom variable tags. The related key-value pairs should be available in data.
      • consent: Optional. The default consent setting for the event. The consent in each conversion data will overwrite the value here.
  • Sample Data file content:

Attributed to a Google Click Identifier (gclid):

{"conversionDateTime": "2020-01-01 03:00:00-18:00", "conversionValue": "20", "gclid": "EAIaIQobChMI3_fTu6O4xxxPwEgEAAYASAAEgK5VPD_example"}

4.8. ACM: Google Ads Customer Match upload via API

API SpecificationValue
API CodeACM
Data FormatJSONL
What Tentacles doesCombined the data with the configuration to build the request body and sent them to Google Ads API endpoint.
Usage ScenariosCustomer Match lets you use your online and offline data to reach and re-engage with your customers across Search, Shopping, Gmail, YouTube, and Display.
Transfer Data onPub/Sub
Authorization MethodOAuth
Role in target systemThe user should at least has 'Standard' access.
Request TypeHTTP Request to RESTful endpoint
# Records per request10
QPS-
ReferenceOverview: Customer Match
  • Sample configuration piece:
{
  "developerToken": "[YOUR-GOOGLE-ADS-DEV-TOKEN]",
  "customerMatchConfig": {
    "customerId": "[YOUR-GOOGLE-ADS-ACCOUNT-ID]",
    "loginCustomerId": "[YOUR-LOGIN-GOOGLE-ADS-ACCOUNT-ID]",
    "listId": "[YOUR-CUSTOMER-MATCH-LIST-ID]",
    "listName": "[YOUR-CUSTOMER-MATCH-LIST-NAME]",
    "uploadKeyType": "CONTACT_INFO|CRM_ID|MOBILE_ADVERTISING_ID",
    "customerMatchUserListMetadata": {
      "consent":{
        "adUserData": "GRANTED|DENIED",
        "adPersonalization": "GRANTED|DENIED"
      }
    },
    "operation": "create|remove"
  }
}
  • Fields' definition:
    • developerToken, Developer token to access the API.
    • customerId, Google Ads Customer account Id
    • loginCustomerId, Login customer account Id (MCC Account Id)
    • listId, User List id for customer match audience. If listId is available listName and uploadKeyType will be ignored.
    • listName, User List name for customer match audience. If the list could not be found, it will be created automatically.
    • uploadKeyType, Customer match upload key types. Must be one of the following: CONTACT_INFO, CRM_ID or MOBILE_ADVERTISING_ID; Read more about upload key types
    • customerMatchUserListMetadata, metadata of the request (CustomerMatchUserListMetadata). It can have a property consent which is the consent setting for all the users in this job.
    • operation, Can be either create or remove in single file; Read more about operation

Tip: For more details see User Data Service

  • Sample Data file content:
{"hashed_email": "47b2a4193b6d05eac87387df282cfbb326ec5296ba56ce8518650ce4113d2700"}

4.9. MP_GA4: Measurement Protocol (Google Analytics 4)

API SpecificationValue
API CodeMP_GA4
Data FormatJSONL
What Tentacles doesMerging the data with the configuration to build the requests and sent them to Google Analytics 4.
Usage ScenariosUploading offline conversions/events
Transfer Data onPub/Sub
Authorization ModeNo Authorization required
Role in target systemN/A
Request TypeHTTP Post
# Records per request1
QPS-
ReferenceMeasurement Protocol (Google Analytics 4) Reference
  • Sample configuration piece:
{
  "qps": 20,
  "numberOfThreads": 20,
  "debug": false,
  "mpGa4Config": {
    "queryString": {
      "firebase_app_id": "[YOUR_APP_ID]",
      "api_secret": "[YOUR_API_SECRET]"
    },
    "requestBody": {
      "non_personalized_ads": false,
      "events": [
        {
          "name": "[YOUR_EVENT_NAME]",
          "params": {}
        }
      ]
    }
  }
}
  • Fields' definition:
    • qps, numberOfThreads and debug optional.
    • qps, numberOfThreads are used to control the sending speed. qps is the 'queries per second' and numberOfThreads stands for how many requests will be sent simultaneously.
    • If debug (default value false) is set as true, Tentacles will NOT send hits to Google Analytics server, instead the hits will be send to Measurement Protocol Validation Server to get validation messages. Errors will be shown in the dashboard. You can use this setting to debug and switch it back to false when the validation is ok.
    • All these properties names in configuration mpGa4Config or data file can be found in Measurement Protocol (GA4) Parameter Reference. Note: requestBody supports embedded properties.
  • Sample Data file content:
{"app_instance_id": "cbd7d1056fexxxxxxxxxxxxxx08ff", "timestamp_micros": 1617508786220000}

4.10. ACA: Google Ads Conversion Adjustments upload via API

API SpecificationValue
API CodeACA
Data FormatJSONL
What Tentacles doesCombined the data with the configuration to build the request body and sent them to Google Ads API.
Usage ScenariosUploading conversion adjustments (e.g. enhanced conversions) to the target conversion.
Transfer Data onPub/Sub
Authorization MethodOAuth
Role in target systemThe user should at least has 'Standard' access.
Request TypeHTTP Request to RESTful endpoint
# Records per request2,000
QPS-
ReferenceUpload Conversion AdjustmentsEnhanced Conversions
  • Sample configuration piece:
{
  "customerId": "[YOUR-GOOGLE-ADS-ACCOUNT-ID]",
  "loginCustomerId": "[YOUR-LOGIN-GOOGLE-ADS-ACCOUNT-ID]",
  "developerToken": "[YOUR-GOOGLE-ADS-DEV-TOKEN]",
  "debug": false,
  "adsConfig": {
    "conversionAction": "[YOUR-CONVERSION-ACTION-NAME]",
    "adjustmentType": "ENHANCEMENT"|"RETRACTION"|"RESTATEMENT",
    "userIdentifierSource": "FIRST_PARTY"
  }
}
  • Fields' definition:
    • customerId, Google Ads Customer account Id.
    • loginCustomerId, Login customer account Id (MCC Account Id).
    • developerToken, Developer token to access the API.
    • debug, optional, default value is false. If it's set as true, the request is validated but not executed. Only errors are returned.
    • adsConfig, configuration items for conversion adjustments:
      • conversionAction, Resource name of the conversion action in the format customers/${customerId}/conversionActions/${conversionActionId}.
      • adjustmentType, for enhanced conversions, it should be ENHANCEMENT.
      • userIdentifierSource: If you uploaded user identifiers in the conversions, you need to specify the source.
  • Sample Data file content:

For an enhanced conversion (adjustmentType is ENHANCEMENT) with hashed email as the UserIdentifier:

{"orderId": "2022032803", "hashedEmail": "47b2a4193b6d05eac87387df282cfbb326ec5296ba56ce8518650ce4113d2700"}

For an enhanced conversion with AddressInfo in UserIdentifier:

{"orderId":"2022040802", "hashedEmail":"47b2a4193b6d05eac87387df282cfbb326ec5296ba56ce8518650ce4113d2700","addressInfo":{"hashedFirstName":"ae3379ac2ab35c1c1cfe33b155f0fb39efaa894a8d84a4dcaa7db23816caffd9","hashedLastName":"1ce3fb2cb03a19b8fd1afdb0e0bd4aa977b8254805e1d4e15d52b6f94cfd21c7","city":"Pyrmont","countryCode":"AU","state":"NSW","postalCode":"2009","hashedStreetAddress":"6cf827c741a060e66b2642117ea91725a51116ea0af7c1809c0bab5297ecd2b7"}}

For a RESTATEMENT type conversions adjustment:

{"orderId":"2022040801", "restatementValue": {"adjustedValue":"1", "currencyCode":"AUD"}, "adjustmentDateTime":"2023-02-23 18:01:23+00:00"}

4.11. AOUD: Google Ads Offline User Data Upload (OfflineUserDataJobService)

API SpecificationValue
API CodeAOUD
Data FormatJSONL
What Tentacles doesCombined the data with the configuration to build the request body and sent them to Google Ads API endpoint.
Usage Scenarios1. Customer Match lets you use your online and offline data to reach and re-engage with your customers across Search, Shopping, Gmail, YouTube, and Display; 2. Uploading and matching transaction data from the business (store sales), shows how ads translate into offline purchases.
Transfer Data onCloud Storage
Authorization MethodOAuth
Role in target systemThe user should at least has 'Standard' access.
Request TypeHTTP Request to RESTful endpoint
# Records per request100,000
QPS-
ReferenceOverview: Customer Match Upload Store Sales Conversions
  • Sample configuration piece:
{
  "developerToken": "[YOUR-GOOGLE-ADS-DEV-TOKEN]",
  "debug": false,
  "offlineUserDataJobConfig": {
    "customerId": "[YOUR-GOOGLE-ADS-ACCOUNT-ID]",
    "loginCustomerId": "[YOUR-LOGIN-GOOGLE-ADS-ACCOUNT-ID]",
    "type": "CUSTOMER_MATCH_USER_LIST|STORE_SALES_UPLOAD_FIRST_PARTY",
    "operation": "create|remove",
    "listId": "[YOUR-CUSTOMER-MATCH-LIST-ID]",
    "listName": "[YOUR-CUSTOMER-MATCH-LIST-NAME]",
    "uploadKeyType": "CONTACT_INFO|CRM_ID|MOBILE_ADVERTISING_ID|CRM_ID|undefined",
    "userAttribute": "UserAttribute|undefined",
    "customerMatchUserListMetadata": {
      "consent":{
        "adUserData": "GRANTED|DENIED",
        "adPersonalization": "GRANTED|DENIED"
      }
    },
    "storeSalesMetadata": "StoreSalesMetadata|undefined",
    "transactionAttribute": "TransactionAttribute|undefined",
    "consent":{
      "adUserData": "GRANTED|DENIED|undefined",
      "adPersonalization": "GRANTED|DENIED|undefined"
    }
  }
}

This connector has two main use cases: 'Customer Match user data upload'CM and 'Store Sales Conversions upload'SSI. In the following, some fields only support one of the use cases.

  • Fields' definition:
    • developerToken, Developer token to access the API.
    • debug, optional, default value is false. In the connector, it should NOT be set as true because in the debug mode the OfflineUserDataJob can not be created hence the following steps will fail.
    • customerId, Google Ads Customer account Id
    • loginCustomerId, Login customer account Id (MCC Account Id)
    • type, type of user data. It should be CUSTOMER_MATCH_USER_LIST for CM or STORE_SALES_UPLOAD_FIRST_PARTY for SSI.
    • operation, Can be either create or remove in single file; Read more about operation
    • listId, CM User List id for customer match audience. If listId is available, listName and uploadKeyType will be ignored.
    • listName, CM User List name for customer match audience. If the list could not be found, it will be created automatically.
    • uploadKeyType, CM Must be one of the following: CONTACT_INFO, CRM_ID or MOBILE_ADVERTISING_ID; Read more about upload key types
    • userAttribute, CM Shared additional attributes of users, see user attribute
    • customerMatchUserListMetadata, CM metadata of the customer match user list(CustomerMatchUserListMetadata). It has a property consent which is the consent setting for all the users in this job.
    • storeSalesMetadata, SSI The metadata for Store Sales Direct, see the details of the metadata.
    • transactionAttribute, SSI Shared additional attributes of transactions, see transaction attribute
    • consent, SSI For Store Sales Conversions, the consent setting should be event(each conversion) level. This config setting here is the default value of each conversion.
4.4.2

18 days ago

4.4.1

23 days ago

4.4.0

25 days ago

4.3.1

1 month ago

4.3.0

2 months ago

4.2.6-v15

2 months ago

4.2.5-v16

2 months ago

4.2.5-v15

2 months ago

4.2.4-v15

2 months ago

4.2.4-v16

2 months ago

4.2.3-alpha

3 months ago

4.2.2-alpha

4 months ago

4.2.1-alpha

4 months ago

4.0.5-beta

6 months ago

4.0.4-beta

7 months ago

4.0.3

7 months ago

4.2.0

5 months ago

4.0.2

8 months ago

4.1.0

6 months ago

4.1.1

6 months ago

4.0.1

10 months ago

3.1.10-beta

11 months ago

4.0.0

11 months ago

3.1.9-alpha

12 months ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.5-beta

1 year ago

3.0.4-beta

1 year ago

3.0.2-beta

1 year ago

3.0.3-beta

1 year ago

3.0.1-beta

1 year ago

2.4.9-alpha-2

2 years ago

3.0.0

1 year ago

2.4.9-alpha

2 years ago

2.4.0

2 years ago

2.3.0

2 years ago

2.2.0

2 years ago

2.1.1-beta

2 years ago

2.0.5

2 years ago

2.1.0

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.4.0

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.4-beta

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.0.0

3 years ago

0.1.0

3 years ago