Skip to content

Commit

Permalink
add note about segment values that must be url encoded
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Aubry committed Feb 15, 2015
1 parent 991d7da commit bf7a1fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/reporting-api-segmentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ will select "Visitors from Search engines AND (Keyword is Piwik OR Keyword is an

{@include http://demo.piwik.org/index.php?module=API&action=listSegments&language=en}

### Segment values must be URL encoded

The segment value (located after the segment operator) must be URL encoded before being sent to Piwik. For example to select all visitors that visited your website via a Search keyword containing `My brand`, you need to URL encode the value such as: `&segment=referrerKeyword!@My%20brand`.

### Segment where value is empty / is not empty

You may sometimes want to segment your analytics reports, for all visitors where a given dimension is empty (a value was not set). This is similar to the SQL "is null" clause. To do so, you can leave the value blank after the operator `==` in the segment string. For example, to select all visitors that did not have any referrer keyword set, you can write:
Expand All @@ -72,4 +76,4 @@ You can combine it with other segments, for example to select all visitors that
Similarly, you can segment your traffic to select visitors where a particular segment is not empty (a value was set). This is similar to the SQL "is not null" clause. To do so, you can leave the value blank after the operator `!=` in the segment string. For example to select all visitors that come from India and have a City set, you can write:
`city!=;countryCode==in`

*Note: Leaving an empty value is supported for the operators == and !==*
*Note: Leaving an empty value is supported for the operators == and !==*

0 comments on commit bf7a1fe

Please sign in to comment.