Filter Formatting #496
Answered
by
polearnik
skibradshaw
asked this question in
Q&A
Replies: 2 comments 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
skibradshaw
-
and one example with $interval = 7; // days for Period
$analyticsData = Analytics::get(
Period::days($interval),
['screenPageViews'],
['pagePath'],
100,
[
OrderBy::metric('screenPageViews', true),
],
0,
new FilterExpression([
'or_group' => new FilterExpressionList([
'expressions' => [
new FilterExpression([
'filter' => new Filter([
'field_name' => 'pagePath',
'string_filter' => new StringFilter([
'match_type' => MatchType::BEGINS_WITH,
'value' => '<yourFilter1>',
]),
]),
]),
new FilterExpression([
'filter' => new Filter([
'field_name' => 'pagePath',
'string_filter' => new StringFilter([
'match_type' => MatchType::BEGINS_WITH,
'value' => '<yourFilter2>',
]),
]),
]),
]
]),
])
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using the ->get method on Analytics to customize specific GA4 Queries. Does anyone know what the filter format should be? The sixth parameter in the Analytics::get() method is a FilterExpression $dimensionFilter but no where can I find the format for these filters. Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions