Understanding Sessions in Ecommerce Analytics
One fundamental metric that helps you take action is the "session."
What is a Session?
A session represents a group of interactions a user takes on your website within a given time frame.
These interactions can include page views, events, transactions, and more.
Sessions are crucial for understanding user behavior, as they provide context for how users navigate and interact with your website.
Tracking Sessions
Sessions are typically tracked by identifying users through their devices.
For instance, if a user visits your website from their laptop and then again from their phone, they will be tracked as two separate users unless cross-device tracking is implemented.
Hereβs a simplified explanation of how sessions work:
- User Identification:
- Users are identified by their devices. Each device is assigned a unique ID to track interactions.
- Example: A user visits your website on their laptop and is assigned an ID (e.g., xyz123). If the same user visits from their phone, they get a different ID (e.g., abc456).
- Session Duration:
- A session typically lasts until there is 30 minutes of inactivity or the user leaves the website. This duration can be adjusted based on your specific needs.
- Example: If a user is inactive for 30 minutes, a new session will start when they return.
- Session Source:
- The source of the session (e.g., a Meta ad, an email) is tracked to understand where the user came from.
- Example: If a user clicks on a Meta ad and visits your website, the session source is recorded as Meta.
Importance of Sessions
Sessions help you understand the flow of interactions on your website. They provide insights into how users engage with your site, which pages they visit, and how effective your marketing efforts are. Here are some key aspects of sessions:
- User Behavior Analysis:
- Sessions allow you to analyze user behavior within a specific time frame, helping you understand how users navigate your site.
- Marketing Attribution:
- By tracking session sources, you can attribute conversions and other key actions to specific marketing channels.
- Performance Metrics:
- Sessions are foundational for calculating other important metrics such as conversion rate, average session duration, and bounce rate.
Exploring Sessions in GA4 and BigQuery
In Google Analytics 4 (GA4), sessions are tracked with unique session IDs. Hereβs how you can explore session data in BigQuery:
SELECT
session_id,
user_pseudo_id,
event_name,
event_timestamp
FROM
`your_project.your_dataset.events_*`
WHERE
event_name IN ('page_view', 'purchase')
AND _TABLE_SUFFIX BETWEEN '20230101' AND '20231231'
This query retrieves session IDs, user IDs, event names, and timestamps for page views and purchases within the specified date range.
Session Timeouts and User Behavior
Sessions can time out after a period of inactivity (default is 30 minutes). This is important for understanding user behavior over multiple visits:
- Multiple Sessions:
- If a user returns to your site after the session timeout, a new session starts.
- Example: A user visits your site, leaves for 40 minutes, and then returns. This will be tracked as two separate sessions.
- Session Source Changes:
- If a user navigates through multiple sources within a session, the first and last sources are tracked.
- Example: A user clicks on a Meta ad, visits your site, signs up for an email, and returns via the email linkβall within 30 minutes. The first source is Meta, and the last source is the email.
Practical Considerations
- Adjusting Session Duration:
- Depending on your business needs, you might want to adjust the session duration in GA4 to better align with user behavior.
- Analyzing Session Data:
- Use session data to analyze the effectiveness of different marketing channels and user engagement on your site.
- Understanding User Journeys:
- Track user journeys across multiple sessions and devices to gain a comprehensive view of user behavior.