Google Merchant Center Lookup variable for Google Tag Manager server container

Written by

Ivanna Holubovska

Updated Aug 21, 2026 comments

Use case

Benefits

How it works

Google Merchant Center Lookup variable for Google Tag Manager server container

Before starting

Enable the Content API on the GCP project

Google Merchant Center Lookup variable for Google Tag Manager server container

Connect the Service Account from the GCP project to Stape

Google Merchant Center Lookup variable for Google Tag Manager server container

Add the Service Account as an admin to the Merchant Center account

How to set up Google Merchant Center Lookup variable

Google Merchant Center Lookup variable for Google Tag Manager server container
Google Merchant Center Lookup variable for Google Tag Manager server container

Google Merchant Center Lookup variable API update

IAM Service Account Credentials API
Merchant API
# Replace these with your actual values GCP_PROJECT_ID="your-gcp-project-id" # https://support.google.com/googleapi/answer/7014113?hl=en MERCHANT_CENTER_ACCOUNT_ID="your-merchant-center-account-id" # https://support.google.com/paymentscenter/answer/7163092?hl=en SERVICE_ACCOUNT_EMAIL="your-service-account@your-project.iam.gserviceaccount.com"
# Set your active gcloud project context gcloud config set project ${GCP_PROJECT_ID} # Generate an access token by impersonating the Service Account with the Merchant Center scope. # If this command throws a permission error, ensure your personal user account # has the "Service Account Token Creator" IAM role on the project. ACCESS_TOKEN=$(gcloud auth application-default print-access-token \ --impersonate-service-account="${SERVICE_ACCOUNT_EMAIL}" \ --scopes="https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/content") # Register the GCP Project with the Merchant Center account curl -X POST \ "https://merchantapi.googleapis.com/accounts/v1/accounts/${MERCHANT_CENTER_ACCOUNT_ID}/developerRegistration:registerGcp" \ -H "Authorization: Bearer ${ACCESS_TOKEN}" \ -H "Content-Type: application/json" \ -d "{}"
{ "name": "accounts/YOUR_MERCHANT_CENTER_ACCOUNT_ID/developerRegistration", "gcpIds": [ "YOUR_GCP_PROJECT_NUMBER" ] }

Conclusion

Interested in server-side?

We are happy to hear that! Click on Try for free to register and check all the possibilities.

Try for free

Written by

Ivanna Holubovska

Content writer

Ivanna is a Lead Content Manager at Stape and a certified author on Clutch and KyivPost. She writes high-quality content on server-side tracking to help businesses optimize strategies and analytics.

Was this article helpful?

Comments

Recommended for you

Turn better tracking into better marketing performance

Try for free