About Segments Feature in Google Analytics

About Segments Feature in Google Analytics - Segments allow you to select users and sessions to answer questions that are important to your business. For example, users that have completed at least 2 transactions with a lifetime revenue of over $1,000, or users who visited first on a mobile device followed by a desktop browser.

This document will familiarize you with the Google Analytics user model and the fundamentals of creating segments.

Google Analytics User Model

Reviewing the Google Analytics User Model first will help you conceptualize how segments work.

There are three major components to the Google Analytics user model:
  • Users — At the basic level you have users.
  • Sessions — A user arrives at and interacts with your property. All of these user interactions are grouped into what is referred to as a session.
  • Hit — During a session the user interacts with your property. Each interaction is referred to as a Hit. Example hits include pageviews, events, transactions, etc.
Once you understand how users are modeled in Google Analytics, the next step is to look at how to create segments.

Segments Examples

To create a segment you define the condition and the dimensions and metrics values you’re interested.

For each example below there is a segment description, the equivalent API Syntax for the segment parameter, and a user model representation.

Conditions

Use conditions to select users or sessions based on dimensions and metrics values.

Dimensions

Select users or sessions based on dimension values.

Users

Select users who came from Canada.
users::condition::ga:country==Canada

Sessions

Select sessions that came from Canada.
sessions::condition::ga:country==Canada

Metrics

Select users or sessions based on single or totaled metric values.

Users

Select users whose total revenue in a single transaction was greater than $100.
users::condition::perHit::ga:transactionRevenue>100

Excluding Conditions

NOT Operator

Use the ! character to negate a condition and exclude the sessions matching that condition.

Exclude sessions where the exit page exactly matches the root page path.
sessions::condition::!ga:exitPagePath==/

Combining Conditions

AND Operator

Use the ; character to combine conditions using the AND operator.

Select users who came from Canada AND whose total revenue across all transactions in the date range was greater than $100.users::condition::ga:country==Canada;users::condition::perUser::ga:transactionRevenue>100

OR Operator

Use the , character to combine filters using the OR operator.

Select users who came from Canada OR who came from Mexico.
users::condition::ga:country==Canada,users::condition::ga:country==Mexico

Sequences

Use sequences to select users or sessions based on sequential conditions.

Select users who visited on mobile immediately followed by a visit on desktop.
users::sequence::ga:deviceCategory==mobile;–>ga:deviceCategory==desktop

Combining Users and Sessions

You can select users and sessions to create a segment. Users will be selected first and sessions will be selected from the subset of users.

Select sessions where total revenue in a single transaction was greater than $100 from users who visited on mobile followed by a visit on desktop.
users::sequence::ga:deviceCategory==mobile;->>ga:deviceCategory==desktop;sessions::condition::perHit::ga:transactionRevenue>100

Next Steps

Review the Segments Dev Guide for complete details on the segments syntax and how to query segments in the Core Reporting API.

Share on Google Plus
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment