Query parameters, SPAs and consent
Roadway reads campaign information from the landing page URL. Keep the query string intact, including in single-page apps and redirects, and respect your consent setup.
Query parameters and SPAs
Roadway reads campaign information from the landing page URL: utm_source, utm_medium, utm_campaign, utm_content, utm_term, and click IDs.
If your tracking drops the query string, attribution can't tell a Google Ads click from a direct visit.
Rules
- Track the full URL.
landing_page_urlmust include query parameters. In GA4 that'spage_location. - Don't strip parameters in redirects. A redirect from
example.com/pricing?utm_campaign=xtowww.example.com/pricingloses the query string unless the redirect preserves it. - Send a page view on every route change in a single-page app. Otherwise only the first page of a session is tracked.
- Don't override URL fields. Custom
page()orpage_viewproperties can replace the real URL.
Single-page apps
| Tool | What to do |
|---|---|
| GA4 (gtag.js) | Send page_view on each route change with page_location set to window.location.href |
| GA4 (GTM) | Use the History Change trigger for your page view tag. Enhanced measurement can also send page_view on history changes. |
| Segment | Call analytics.page() on each route change |
| PostHog | capture_pageview: 'history_change' in init options, or call posthog.capture('$pageview') per route |
PostHog page views
If PostHog is your page-view source, page views must come from posthog-js in the browser. Server-side page views count as anonymous.
Redirects and landing pages
- Test every ad destination URL. Open it in a private window and confirm the final URL still contains the parameters.
- If a redirect must drop parameters, copy them into the destination URL, or capture them before redirecting.
- Use
httpsand a single canonical host so cookies and IDs aren't split acrossexample.comandwww.example.com.
Verify
-- BigQuery, GA4 export: share of page views with a utm_source in the URL
SELECT
COUNTIF(REGEXP_CONTAINS(page_location, r'[?&]utm_source=')) / COUNT(*) AS share_with_utm_source
FROM (
SELECT (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_location') AS page_location
FROM `your_project.analytics_PROPERTY_ID.events_*`
WHERE event_name = 'page_view'
AND _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY))
);
If your paid traffic is significant, this share should be well above zero.
Vendor docs: Measure single-page applications (GA4)
Consent and privacy
Roadway's attribution depends on cookies and local storage that your analytics tools set.
Consent choices and browser privacy features can remove them.
No PII
- Don't use an email address, name, or phone number as
userID,anonymousID, or a custom dimension. - Roadway doesn't use PII, even for users. Remove PII from tables before you connect them, for example by exposing a view. See Create PII-free views.
- Google Analytics policy prohibits sending PII, including as a user ID.
How consent affects IDs
| Situation | Effect on Roadway |
|---|---|
| Visitor declines analytics cookies, and your analytics tool is blocked | No page view, no ID. The visitor is invisible to Roadway. |
| Consent granted later in the session | Earlier page views may not be recorded. The first recorded page view may not be the landing page, so UTM data can be lost. |
| GA4 Consent Mode with analytics storage denied | Google may send cookieless pings without a stable client ID. The Roadway tag can't read an ID that doesn't exist. |
| Safari or Firefox tracking prevention | Cookies set by JavaScript may expire sooner. A returning visitor may get a new ID. |
| Ad blockers | The analytics script may not load. |
What you can do
- Load analytics before consent where your legal basis allows. Work with your counsel on this.
- Load the Roadway tag together with analytics. The tag reads IDs that analytics tools create. If analytics is blocked, the tag has nothing to copy. Use the same consent category for both.
- Capture UTM parameters early. Make sure the first recorded page view is the landing page.
- Test in a clean browser profile with your consent banner on.
The tag makes no network requests of its own. Loading it fetches tag.js from analytics.roadwayai.com. It writes IDs into form fields, sends
hubspot_form_submissionto your GA4 and PostHog, and may briefly write a localStorage test key. Review the live tag file with your privacy team.
Vendor docs: Consent mode (Google)