PingBell
Docs

Google Forms integration

Connect a Google Form to a PingBell counter in under 3 minutes using a small Google Apps Script. No Zapier. No polling. Real-time.

Before you start

  • A PingBell account (free trial)
  • A counter created in PingBell, with its unique webhook URL copied to your clipboard
  • A Google Form you own and can edit Apps Script on
  • 2-3 minutes

Step 1 — Open the Form's Script editor

  1. Open your Google Form in edit mode
  2. Click the three-dot menu (top-right)
  3. Select Script editor. A new tab opens to Apps Script.

Step 2 — Paste the script

Replace the entire contents of Code.gs with the following, then replace the URL constant with your PingBell counter's webhook URL:

// PingBell — Google Forms integration
// Paste this into: Your Form > kebab menu > Script editor
// Replace PINGBELL_WEBHOOK_URL with your counter's webhook URL.

const PINGBELL_WEBHOOK_URL = 'https://api.pingbell.io/v1/counters/<YOUR_COUNTER_ID>/events';

function onFormSubmit(e) {
  const itemResponses = e.response.getItemResponses();
  const metadata = {};

  for (const ir of itemResponses) {
    const key = ir.getItem().getTitle().replace(/\s+/g, '_').toLowerCase();
    metadata[key] = ir.getResponse();
  }

  const payload = {
    value: 1,
    timestamp: new Date().toISOString(),
    metadata: metadata,
  };

  UrlFetchApp.fetch(PINGBELL_WEBHOOK_URL, {
    method: 'post',
    contentType: 'application/json',
    payload: JSON.stringify(payload),
    muteHttpExceptions: true,
  });
}

Step 3 — Set up the trigger

  1. In the Apps Script editor, click the Triggers icon (the clock, left sidebar)
  2. Click Add Trigger
  3. Configure:
    • Function: onFormSubmit
    • Event source: From form
    • Event type: On form submit
  4. Click Save. Google will ask you to authorize the script — approve the permissions to allow outbound HTTP requests.

Step 4 — Test it

  1. Fill out and submit your form
  2. Open your PingBell dashboard; the counter should increment within 3 seconds
  3. Check the notification template filled in the form values correctly

Troubleshooting

The script runs but the counter doesn't move

Verify the webhook URL is correct. In Apps Script, open Executions and inspect the latest run for a non-200 response code.

Authorization fails

Some Google Workspace for Education domains restrict Apps Script outbound HTTP. Ask your admin to whitelist api.pingbell.io or use the Zapier path instead.

Form answers aren't appearing in the notification

Check the template-variable names. The script lowercases and underscores field titles, so “Full Name” becomes {{full_name}} in the PingBell notification template.