Analytics & SEO setup
Configure Google Analytics 4, Search Console, and conversion tracking for the docs site.
Google Analytics 4 property
- Measurement ID:
G-CPT1BL1T96 - Property name: SquarebyWPPayments
- Site: payments-connect-square.pages.dev
Tracking is injected on every page at build time via hooks.py.
Register Key Events (do this once in GA4 Admin)
Custom events fired by the docs site are not counted as conversions until you mark them as key events:
- Open Google Analytics → property SquarebyWPPayments
- Admin → Data display → Events
- Wait 24–48 hours after launch for events to appear, or test by clicking buttons on the live site
- Toggle Mark as key event for:
| Event name | Triggered when |
|---|---|
plugin_download_click |
User clicks Download on WordPress.org (sticky bar, footer, inline) |
support_whatsapp_click |
User opens WhatsApp from Support form |
feature_request_whatsapp_click |
User opens WhatsApp from Feature requests |
Test Realtime
- Open Reports → Realtime
- Visit the docs site in an incognito window (disable ad blockers)
- Click a download button — watch for
plugin_download_clickunder Event count by Event name
!!! tip "No Realtime data?" Ad blockers (uBlock, Brave) block GA4. Test in Chrome incognito without extensions.
Google Search Console
- Property:
https://payments-connect-square.pages.dev/(URL prefix) - Verification: HTML file
google9fcf0f0d145ece39.html(keep on site — do not delete) - Sitemap:
sitemap.xml(submit under Indexing → Sitemaps)
GSC PAP in Cursor (optional)
Connect GSC PAP to ask search analytics questions in Cursor:
- Sign in at gscpap.com → copy bearer token
- Cursor → Settings → MCP → update
gsc-papAuthorization header - Ask: "What are my top queries for payments-connect-square.pages.dev?"
UTM parameters
| Source | utm_source | utm_medium |
|---|---|---|
| Docs download buttons | docs_site |
download_button |
| WordPress.org readme | wordpress_org |
readme |
| Plugin admin | wordpress_org |
wp_admin |
| Blog posts | docs_site |
blog |
In GA4: Reports → Acquisition → Traffic acquisition → filter by session source.
Cloudflare Pages environment variables
Set these in Cloudflare Dashboard → Workers & Pages → payments-connect-square → Settings → Environment variables so Git auto-deploys never drop tracking:
| Variable | Value |
|---|---|
GA4_MEASUREMENT_ID |
G-CPT1BL1T96 |
GSC_VERIFICATION |
l4g7JMtZSX-ltYaUTRWNMLtIFEt3lwYqYTCOEEQA2n8,3po3l-SQTgul8CfecRuRsVxFLZEadqs_10yXAOnMGVg |
PYTHON_VERSION |
3.11 |
Local deploy via deploy.cmd sets these automatically.
Custom domain (optional)
For stronger SEO and brand trust:
- Add
docs.yourdomain.comin Cloudflare Pages → Custom domains - Update
site_urlinmkdocs.yml - Add the new property in Google Search Console
- Define in WordPress
wp-config.php:define( 'SHC4WC_DOCS_BASE_URL', 'https://docs.yourdomain.com' );