Escape Characters for Filter/Segment Expressions - Not Working as stated in the doc.

614 views
Skip to first unread message

pratha...@persistent.co.in

unread,
Dec 16, 2013, 7:02:53 AM12/16/13
to google-analytics...@googlegroups.com

Hi,


While performing extraction of data from Google Analytics(GA) we went through following information.


This link has reference and talks about using escape characters/count of characters while writing filer/segment expressions as give below.


Filter Expressions


There are a couple of important rules for filter expressions:

  • URL-reserved characters — Characters such as & must be url-encoded in the usual way.
  • Reserved characters — The semicolon, comma, and backslash must all be backslash escaped when they appear in an expression.
    • semicolon \;
    • comma \,
    • backslash \\
  • Regular Expressions — You can also use regular expressions in filter expressions using the =~ and !~ operators. Their syntax is similar to Perl regular expressions and have these additional rules:
    • Maximum length of 128 characters — Regular expressions longer than 128 characters result in a 400 Bad Request status code returned from the server.
    • Case sensitivity — Regular expression matching is case-insensitive.
Based on the above facts we tested for the segment which has ',' and  ';'  in the expression for segment and it still worked.

Similarly we tested the regular expression for segment with more than 128 characters. That also happened to work fine.

If both these facts are considered then above two tests should have failed. Which is not the case.

Can anybody please explain what is the significance of escape characters and number of characters if both these are not working as per the statements?

Regards,
Prathamesh


Pete

unread,
Dec 26, 2013, 2:27:30 PM12/26/13
to google-analytics...@googlegroups.com
can you provide some examples? The easiest way is to use the Query Explorer (http://ga-dev-tools.appspot.com/explorer/) and then copy and paste the queries in your reply.
Reply all
Reply to author
Forward
0 new messages