Google Analytics Data V1alpha Client - Class Segment (0.20.1)

Reference documentation and code samples for the Google Analytics Data V1alpha Client class Segment.

A segment is a subset of your Analytics data. For example, of your entire set of users, one segment might be users from a particular country or city.

Another segment might be users who purchase a particular line of products or who visit a specific part of your site or trigger certain events in your app. To learn more, see Segment Builder .

Generated from protobuf message google.analytics.data.v1alpha.Segment

Namespace

Google \ Analytics \ Data \ V1alpha

Methods

__construct

Constructor.

Parameters
Name
Description
data
array

Optional. Data for populating the Message object.

↳ name
string

The name for this segment. If unspecified, segments are named "Segment". This name defines string value returned by the segment dimension. The segment dimension prefixes segment names by the 1-based index number of the segment in the request (for example "1. Segment", "2. Segment", etc.).

↳ user_segment
UserSegment

User segments are subsets of users who engaged with your site or app.

↳ session_segment
SessionSegment

Session segments are subsets of the sessions that occurred on your site or app.

↳ event_segment
EventSegment

Event segments are subsets of events that were triggered on your site or app.

getName

The name for this segment. If unspecified, segments are named "Segment".

This name defines string value returned by the segment dimension. The segment dimension prefixes segment names by the 1-based index number of the segment in the request (for example "1. Segment", "2. Segment", etc.).

Returns
Type
Description
string

setName

The name for this segment. If unspecified, segments are named "Segment".

This name defines string value returned by the segment dimension. The segment dimension prefixes segment names by the 1-based index number of the segment in the request (for example "1. Segment", "2. Segment", etc.).

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getUserSegment

User segments are subsets of users who engaged with your site or app.

Returns
Type
Description
UserSegment |null

hasUserSegment

setUserSegment

User segments are subsets of users who engaged with your site or app.

Parameter
Name
Description
Returns
Type
Description
$this

getSessionSegment

Session segments are subsets of the sessions that occurred on your site or app.

Returns
Type
Description

hasSessionSegment

setSessionSegment

Session segments are subsets of the sessions that occurred on your site or app.

Parameter
Name
Description
Returns
Type
Description
$this

getEventSegment

Event segments are subsets of events that were triggered on your site or app.

Returns
Type
Description
EventSegment |null

hasEventSegment

setEventSegment

Event segments are subsets of events that were triggered on your site or app.

Parameter
Name
Description
Returns
Type
Description
$this

getOneSegmentScope

Returns
Type
Description
string
Create a Mobile Website
View Site in Mobile | Classic
Share by: