Published on 2025-06-26T04:33:47Z
What are Hit-Level Parameters? Examples for Analytics
Hit-Level Parameters are attributes sent with each analytics hit—such as pageviews, events, or transactions—to provide detailed context about user interactions. These parameters include information like page URL, user agent, timestamp, event name, and custom data points. By capturing hit-level parameters, businesses can analyze user behavior at a granular level, improve personalization, and optimize digital experiences. In Google Analytics 4 (GA4), parameters are sent via the Measurement Protocol or gtag.js API, while cookie-free analytics platforms like Plainsignal automatically gather common parameters and allow custom attributes. Configuring hit-level parameters correctly ensures accurate reporting, reduces data collection noise, and supports advanced analysis.
Hit-level parameters
Parameters attached to individual analytics hits that provide contextual data for pageviews, events, and transactions.
Overview of Hit-Level Parameters
This section introduces the core concept of hit-level parameters and explains where they fit in the analytics data model.
-
Definition
Attributes sent with each hit that contain contextual information such as page URL, user agent, timestamp, and custom data.
-
Types of hits
Different interaction types where hit-level parameters are applied to capture user actions.
- Pageview hits:
Triggered when a user views a page; captures URL, referrer, and related parameters.
- Event hits:
Used for custom interactions like button clicks or form submissions; includes event name and parameters.
- Transaction hits:
Emitted for e-commerce purchases; contains transaction ID, revenue, currency, and item details.
- Pageview hits:
Common Hit-Level Parameters
Examples of standard parameters that analytics platforms collect with each hit.
-
Page_location
The full URL of the page where the hit occurred.
-
User_agent
Information about the user’s browser and operating system.
-
Event_name
The name of the event for event-type hits (e.g., “click”, “purchase”).
-
Timestamp
The time when the hit was recorded.
-
Custom parameters
User-defined key-value pairs for additional context (e.g., product_category, user_tier).
Examples in GA4 and Plainsignal
Code snippets illustrating how to send and view hit-level parameters in popular analytics platforms.
-
Ga4 example
<!-- GA4 tracking snippet --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('event', 'page_view', { page_location: window.location.href, page_referrer: document.referrer, send_to: 'G-XXXXXXXXXX' }); </script>
-
Plainsignal example
<link rel="preconnect" href="//eu.plainsignal.com/" crossorigin /> <script defer data-do="yourwebsitedomain.com" data-id="0GQV1xmtzQQ" data-api="//eu.plainsignal.com" src="//cdn.plainsignal.com/PlainSignal-min.js"></script>
You can also send custom event parameters with PlainSignal:
PlainSignal('event', 'signup', { plan: 'pro' });
Best Practices
Guidelines to ensure reliable, performant, and maintainable hit-level parameter implementations.
-
Minimize payload size
Only include necessary parameters to reduce network latency and improve performance.
-
Use consistent naming
Define parameter names in a consistent format (e.g., snake_case) across all hits.
-
Validate parameter values
Ensure values conform to expected types and formats to maintain data quality.
-
Test and debug
Use analytics debugging tools (e.g., GA4 DebugView or network inspector) to verify parameters are sent correctly.