Shopify Webhooks to Google Sheets: What You Need
In this article
Shopify webhooks cannot post directly to a Google Sheet because Google Sheets has no public endpoint that accepts incoming webhook payloads. To bridge them, you need a middle layer—like Google Apps Script, Zapier, Make, or a custom server—that receives Shopify’s HTTP request and writes the data into the spreadsheet via the Sheets API. This article explains why the direct connection fails, what the viable options are, and how to choose and implement one.
Why Direct Posting Fails
Shopify sends webhooks as HTTP POST requests to a URL you specify in the Shopify admin. The request contains a JSON body with the event data (e.g., order details, customer info, product updates). Google Sheets, however, is a spreadsheet application, not a web server. It has no built-in “receive POST” endpoint. The only official way to write data into a sheet programmatically is through the Google Sheets API, which requires authentication (OAuth 2.0 or an API key) and a client that can make authorized requests. A raw webhook from Shopify cannot authenticate to Google’s API, and Google will reject any unauthenticated POST to its Sheets endpoints.
Additionally, Shopify expects a response within a few seconds (it retries on failure, but with delays). A spreadsheet is not designed to process and acknowledge HTTP requests in real time. Even if you tried to send the webhook to a Google Form URL (which does accept POSTs), the data would land in the form’s response sheet, not your target sheet, and you’d have to map fields manually—and that only works for form submissions, not arbitrary webhook payloads.
How Shopify Webhooks Actually Work
When you create a webhook in Shopify admin (Settings → Notifications → Webhooks), you choose an event (like “orders/create” or “products/update”) and provide a destination URL. Shopify then sends an HTTPS POST request to that URL whenever the event fires. The request includes:
- Headers:
X-Shopify-Topic(event type),X-Shopify-Shop-Domain,X-Shopify-Webhook-Id, and a signature header (X-Shopify-Hmac-Sha256) for verification. - Body: JSON with the full resource data (e.g., order object with line items, customer, totals).
- Retry behavior: Shopify retries failed deliveries up to 19 times over 48 hours with exponential backoff.
Your receiving endpoint must respond with a 2xx status quickly; otherwise Shopify considers it a failure and retries. This is why a simple “send to Google Sheets” idea fails—you need an endpoint that can parse the request, authenticate to Google, and write the row.
Option 1: Google Apps Script (Free, Custom)
Google Apps Script is a JavaScript-based platform that runs on Google’s servers. You can create a script that has its own URL (via doPost(e) function) and that URL can be set as the webhook destination in Shopify. When Shopify sends the POST, the script runs, parses the JSON, and writes to your sheet using the SpreadsheetApp service.
Steps:
- Open your Google Sheet, go to Extensions → Apps Script.
- Write a
doPost(e)function that readse.postData.contents, parses JSON, and appends a row to the sheet. - Deploy the script as a web app (Deploy → New deployment → Web app), set “Execute as” to “Me” and access to “Anyone” (or “Anyone with link” if you add verification).
- Copy the web app URL and paste it into Shopify’s webhook destination.
Pros: Free, no external service, full control. Cons: Requires coding; you must handle Shopify’s HMAC verification yourself (optional but recommended); the script has a 6-minute execution limit but for simple writes it’s fine; Google may throttle requests if you have high volume.
Option 2: Zapier or Make (No-Code, Paid)
Zapier and Make (formerly Integromat) are automation platforms that connect apps via triggers and actions. You create a “Zap” (Zapier) or “Scenario” (Make) where the trigger is “Webhook” (they give you a unique URL) and the action is “Google Sheets – Add Row”.
Steps (Zapier):
- Create a new Zap, choose “Webhooks by Zapier” as the trigger, select “Catch Hook”.
- Copy the webhook URL and paste it into Shopify.
- Test the trigger (Shopify sends a test payload).
- Add a “Google Sheets” action, choose “Add Row”, connect your Google account, select the spreadsheet and worksheet.
- Map the fields from the webhook payload to the columns.
Pros: No code, visual mapping, handles retries and authentication. Cons: Costs money beyond free tiers (Zapier free tier is limited to 100 tasks/month; Make has a free tier with 1,000 operations/month). Also adds latency and depends on third-party uptime.
Option 3: Custom Server / Cloud Function
If you have programming skills, you can run a small server (Node.js, Python) or a serverless function (AWS Lambda, Google Cloud Functions) that receives the webhook, verifies the HMAC signature, and writes to Google Sheets using the Google Sheets API with a service account.
This gives you maximum control and scalability, but you must manage hosting, authentication, and error handling. For most merchants, this is overkill unless you already have a backend.
How to Choose the Right Approach
Consider these factors:
- Technical skill: Non-coders should use Zapier or Make. Coders may prefer Apps Script or a custom server.
- Budget: Apps Script is free (with Google account). Zapier/Make have subscription costs.
- Volume: Apps Script can handle a few hundred events per day; for thousands, consider a server or paid automation.
- Data complexity: If you need to transform data (e.g., combine line items), a script or server gives more flexibility.
- Security: If you handle sensitive data, verify the HMAC signature to ensure the request is genuinely from Shopify.
Common Problems and Solutions
1. Webhook not firing: Check that the webhook is active and the event name matches exactly (e.g., “orders/create” not “order created”). Test by creating a real order in a development store.
2. Data not appearing: Check the script/automation logs. In Apps Script, use Logger.log() and view Execution transcript. In Zapier, check the Zap history.
3. Duplicate rows: Shopify retries on failure; if your script takes too long or returns an error, you get duplicates. Ensure your endpoint responds quickly and idempotently (e.g., check if order ID already exists).
4. HMAC verification fails: If you implement verification, ensure you use the correct secret from Shopify admin and compute HMAC-SHA256 with the raw body. A common mistake is using the JSON parsed body instead of the raw string.
5. Google Sheets rate limits: If you write too frequently, you may hit quota. Add a small delay or batch writes.
Costs and Limits
Apps Script: Free for personal use, but Google may impose daily quotas (e.g., 20,000 URL fetch calls per day). For most small stores, that’s plenty.
Zapier: Free plan (100 tasks/month), paid plans start around $20/month for 750 tasks. Make: Free plan (1,000 operations/month), paid plans start around $9/month.
Custom server: Cost of hosting (e.g., $5/month for a small VPS) plus your time.
Also note that Shopify webhooks themselves are free and unlimited (within reason).
Frequently Asked Questions
Can I use a Google Form as a webhook receiver? Yes, but it’s a hack. Google Forms accept POST requests to their form URL, and the data appears in the linked response sheet. However, you cannot map arbitrary JSON fields easily—you’d have to predefine fields in the form and ensure Shopify sends matching parameter names. It’s not recommended for production.
Do I need to verify Shopify’s webhook signature? It’s highly recommended. Without verification, anyone who discovers your endpoint could send fake data. Shopify provides an HMAC-SHA256 signature in the X-Shopify-Hmac-Sha256 header, and you can compute it using your webhook secret.
What if I miss a webhook because my script was down? Shopify retries failed deliveries up to 19 times over 48 hours. If your script is down for a short time, it will likely catch up. For long outages, you may need to manually sync data.
Can I send webhooks to multiple Google Sheets? Yes. You can create multiple webhooks in Shopify (one per event) pointing to different Apps Script URLs, or in Zapier you can duplicate the Zap with different sheet targets.
Is there a delay between the event and the sheet update? Typically 1–5 seconds with Apps Script or Zapier, depending on load. For real-time needs, this is usually acceptable.
Can I update an existing row instead of appending? Yes. In Apps Script, you can search for an order ID and update the row. In Zapier, you can use “Update Row” action if you have a lookup field, but it’s more complex.