Server-Side Google Tag Manager
Server-Side Google Tag Manager — Setup Guide
ReDi Restaurant Reservation plugin supports server-side Google Tag Manager (sGTM) for accurate conversion tracking. When a guest makes a reservation, the plugin sends a reservation_complete event directly from your server to Google Analytics 4 — bypassing ad blockers and browser restrictions.
This feature also tracks referral attribution: if a guest arrives from Google Ads, clicks through several pages, and books a table later — the reservation is correctly attributed to the original ad click.
What you need before starting
Google Analytics 4 property with a web data stream
Google Tag Manager server-side container (deployed)
Access to ReDi plugin settings in WordPress admin
If you don't have a server-side GTM container yet, see "Deploying a server-side container" at the end of this guide.
Step 1: Create a GA4 Measurement Protocol API Secret
Go to Google Analytics
Navigate to Admin → Data Streams → select your web stream
Scroll down to Measurement Protocol API secrets
Click Create and give it a name (e.g. "ReDi sGTM")
Copy the generated Secret value — you'll need it in Step 3
Also note your Measurement ID from the top of this same page (format: G-XXXXXXXXXX).
Step 2: Verify your sGTM container URL
Your server-side GTM container has a URL, typically something like:
https://gtm.yourdomain.com
or if using Google's default:
https://your-project-id.uc.r.appspot.com
Make sure this container is running and accessible. You can test by visiting the URL in a browser — it should return a blank page or a small response (not a 404 or error).
Step 3: Configure the ReDi plugin
In WordPress admin, go to ReDi Restaurant → Settings
Find the Server-Side Google Tag Manager section
Fill in the three fields:
Field | Value | Example |
|---|---|---|
sGTM Endpoint URL | Your server container URL |
|
GA4 Measurement ID | From your GA4 data stream |
|
GA4 API Secret | From Step 1 |
|
Save settings
That's it on the WordPress side. The plugin will now automatically:
Capture referral data (UTM parameters, Google click IDs) when guests first visit your site
Preserve that data as the guest navigates between pages
Send a
reservation_completeevent to your sGTM container when a reservation is successfully created
Step 4: Configure your sGTM container to receive events
In your Google Tag Manager server-side container:
4a. Add a GA4 Client
Go to Clients → New
Choose GA4 client type
Leave default settings
Save
This client listens for incoming Measurement Protocol requests.
4b. Add a GA4 Event Tag
Go to Tags → New
Choose Google Analytics: GA4 tag type
Configure:
Measurement ID: your
G-XXXXXXXXXXLeave "Use Default GA4 Configuration" checked
Set trigger: create a custom trigger where Event Name equals
reservation_completeSave
4c. (Optional) Add a Google Ads Conversion Tag
If you want reservations to count as Google Ads conversions:
Go to Tags → New
Choose Conversion Linker tag (if not already present) — set it to fire on all events
Create another tag: Google Ads Conversion Tracking
Configure with your Conversion ID and Conversion Label from Google Ads
Set trigger: same
reservation_completetriggerSave
4d. Publish the container
Click Submit in the top right to publish your sGTM container changes.
What data is sent with each reservation event
Parameter | Description | Example |
|---|---|---|
| Unique reservation number |
|
| Number of guests |
|
| Reservation date and time |
|
| Booking source |
|
| Traffic source |
|
| Marketing medium |
|
| Campaign name |
|
| Search keyword (if available) |
|
| Ad variation (if available) |
|
| Google Ads click ID |
|
| Google Ads iOS click ID | (if applicable) |
| Facebook click ID | (if applicable) |
| Original referring URL |
|
| First page the guest visited |
|
The client_id is also sent for GA4 session stitching — it is read automatically from the guest's _ga cookie if Google Analytics is running on the site.
How attribution tracking works
A guest clicks a Google Ad and lands on your site (e.g. the menu page)
The plugin captures the referral data (
gclid, UTM parameters, referrer URL) and stores it in a first-party cookie on your domainThe guest browses your site — menu, about page, location, etc. The cookie persists across all pages
The guest navigates to the reservation page and books a table
When the reservation is confirmed, the plugin reads the stored attribution data and sends it to your sGTM container along with the reservation details
Google Analytics 4 (and optionally Google Ads) receives the event with correct attribution
This works regardless of which page the guest landed on first, and even if they visit multiple pages before making a reservation.
The attribution cookie uses first-touch logic: if a guest returns later from a different source, the original attribution is preserved (30-day window).
Testing your setup
Quick test
Visit your restaurant website with test UTM parameters:
https://your-restaurant.com/?utm_source=google&utm_medium=cpc&utm_campaign=test123&gclid=fakeclickidNavigate to a different page on the site
Go to the reservation page and make a test reservation
Check Google Analytics 4 → Realtime → Events — you should see
reservation_completewith the test UTM values
Verify the cookie
After visiting with UTM parameters, open your browser Developer Tools (F12)
Go to Application → Cookies → your domain
Look for
redi_attribution— it should contain your UTM parameters
Verify in ReDi dashboard
The attribution data is also saved with each reservation as a TrackingCode parameter. You can see it in the reservation details in the ReDi management dashboard.
Troubleshooting
Problem | Solution |
|---|---|
No events appearing in GA4 Realtime | Check that all three settings fields are filled in correctly. Verify your sGTM container is running. |
Cookie not being set | Make sure the guest is visiting the site with UTM parameters or from an external referrer. Direct visits without parameters don't create a cookie (this is by design). |
| This means GA4 client-side tracking (gtag.js) is not running on the site. The event still works, but session stitching won't link it to the web session. Install GA4 on the site for full integration. |
Events arrive but with empty attribution | The guest visited directly (no referrer, no UTM params). This is normal — not all reservations come from ad clicks. |
Google Ads not showing conversions | Make sure you have a Conversion Linker tag and a Google Ads Conversion Tracking tag in your sGTM container, both configured to fire on |
Deploying a server-side GTM container (if you don't have one)
Google provides a free-tier option using Google Cloud:
Go to tagmanager.google.com
Create a new Container → select Server as the target platform
Choose Automatically provision → this deploys on Google Cloud Run
Follow the setup wizard — Google will create the server and give you the container URL
Use that URL as your sGTM Endpoint URL in the ReDi plugin settings
Google Cloud Run offers a generous free tier that is sufficient for most restaurant websites.
For detailed instructions, see Google's official sGTM setup guide.
Privacy and consent
The attribution cookie (redi_attribution) is a first-party, functional cookie set on your restaurant's own domain. It does not track users across sites and contains no personal information — only marketing parameters from the URL.
If your site uses a cookie consent banner (recommended for GDPR compliance), you may want to classify this cookie under "Marketing" or "Analytics" cookies and only set it when the guest has given consent. Contact ReDi support for guidance on integrating with your specific consent management platform.
Server-side events should respect the same consent decisions as client-side tracking. If a guest has not consented to analytics cookies, the attribution cookie will not be present and no server-side event with attribution data will be sent.