Connect Google
Search Console keywords with revenue, Google Ads cost and GA4 history, and what each permission is for.
Open the site's Settings, then Integrations. Each Google product is turned on by itself, and Google asks you to allow just the permission that product needs. You can allow Search Console today and Google Ads next month; the one connection covers both. Only an admin of the site can connect or disconnect.
What each permission is for
| webmasters.readonly | Search Console: the searches, clicks, impressions and positions for the property you choose. Read only. |
| adwords | Google Ads: daily cost, clicks and impressions per campaign. Google offers no read-only Ads permission; Pathrail only runs reports and never changes a campaign or budget. |
| analytics.readonly | GA4: daily totals for the property you choose, for the import. Read only. |
| openid, email | Which Google account is connected, so settings can show it. |
Search Console and Keywords
After you choose a property, Pathrail pulls the last 90 days, then re-reads the last few days twice a day (Google's numbers settle about two days late). The Keywords page shows each search with its clicks, impressions, click-through rate and average position, plus the revenue and signups it led to.
Revenue per search is an estimate. Google never says which search a paying visitor typed. So for each landing page, Pathrail takes the revenue and signups from visitors who first arrived from Google organic search on that page, and splits them across that page's searches by share of clicks. A page with 100 clicks and 100 in revenue gives a search with 60 of those clicks 60. Clicks Google hides for privacy keep their share on a row of their own, so the searches never add up to more than you earned.
Google Ads cost
Choose the Ads account (its customer id). Cost per campaign is pulled daily and matched to visits by utm_campaign: Pathrail reads it from the campaign's final URL suffix or tracking template (or the account's), and uses the campaign name when there is none. Tag your ads with utm_campaign set to a fixed value or {campaignid} so cost and visits line up.
GA4 import
Choose a GA4 property, then use Import under Imports. Pathrail fills daily totals plus sources, channels, pages, landing pages, countries, devices, browsers and operating systems for the days before its own data starts, and skips days another import already filled. GA4's channel groups are mapped to Pathrail's (Affiliates becomes Affiliate, Display and Cross-network become Paid Other, and so on). Undo removes exactly the days it added.
Disconnecting
Disconnect revokes Pathrail's access at Google and deletes the stored token and Search Console data. Ad cost already pulled is kept, since it is the history your return on ad spend is worked out from.
Running your own server
Create an OAuth client of type Web application in Google Cloud, enable the Search Console, Google Ads, Google Analytics Data and Google Analytics Admin APIs, and add https://your-domain/api/integrations/google/callback as a redirect URI. Then set:
| PR_GOOGLE_CLIENT_ID | The OAuth client id. Integrations stay hidden until this and the secret are set. |
| PR_GOOGLE_CLIENT_SECRET | The OAuth client secret. |
| PR_GOOGLE_ADS_DEVELOPER_TOKEN | Needed for Google Ads only, from the Ads API Center of a manager account. |
| PR_GOOGLE_ADS_LOGIN_CUSTOMER_ID | Optional: the manager account id, when the Ads accounts are reached through one. |
| PR_GOOGLE_ADS_API_VERSION | Optional: the Ads API version, v22 by default. |
Google must verify the OAuth consent screen before people outside your own Google Workspace can allow these permissions. Until then only test users you list can connect.