Loading ...
Sorry, an error occurred while loading the content.

Regex basics help

Expand Messages
  • WebberAnalytics Smith
    Hi All, Can anyone give me a quick 101 on regex in GA? Essentially I d like to create a URL goal regular expression match for any pages that contain these 2
    Message 1 of 9 , Sep 12, 2012
    • 0 Attachment
      Hi All,

      Can anyone give me a quick 101 on regex in GA? Essentially I'd like to
      create a URL goal regular expression match for any pages that contain these
      2 phrases in the URL: product and cart
      Essentiall my logic is give me any URLs where the URL contains both
      'product' AND 'cart'.

      Help!

      Thanks


      [Non-text portions of this message have been removed]
    • Mohit Jain
      Hi, Please separate your phrases by a PIPE (|) So in Goal RegEx write product|cart I hope that will help. thanks, Mohit www.mohit.ae On Thu, Sep 13, 2012 at
      Message 2 of 9 , Sep 13, 2012
      • 0 Attachment
        Hi,

        Please separate your phrases by a PIPE (|)

        So in Goal RegEx write product|cart

        I hope that will help.

        thanks,

        Mohit
        www.mohit.ae


        On Thu, Sep 13, 2012 at 4:25 AM, WebberAnalytics Smith <
        webberanalytics@...> wrote:

        > **
        >
        >
        > Hi All,
        >
        > Can anyone give me a quick 101 on regex in GA? Essentially I'd like to
        > create a URL goal regular expression match for any pages that contain these
        > 2 phrases in the URL: product and cart
        > Essentiall my logic is give me any URLs where the URL contains both
        > 'product' AND 'cart'.
        >
        > Help!
        >
        > Thanks
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >


        [Non-text portions of this message have been removed]
      • anakravitz
        The pipe is really useful but I m not sure that will work here since it means OR. So in this case it would return URLs that contain either the word product
        Message 3 of 9 , Sep 13, 2012
        • 0 Attachment
          The pipe is really useful but I'm not sure that will work here since it means OR.

          So in this case it would return URLs that contain either the word "product" OR the word "cart". But he wants URLs that contain both of those words together.

          I think the regex that will work is (product.*cart)|(cart.*product).

          If you know that "product" always comes before "cart" you can drop the second part and vice versa. Hope that helps!
          -Ana
          www.akravitz.com

          --- In webanalytics@yahoogroups.com, Mohit Jain <mohit@...> wrote:
          >
          > Hi,
          >
          > Please separate your phrases by a PIPE (|)
          >
          > So in Goal RegEx write product|cart
          >
          > I hope that will help.
          >
          > thanks,
          >
          > Mohit
          > www.mohit.ae
          >
          >
          > On Thu, Sep 13, 2012 at 4:25 AM, WebberAnalytics Smith <
          > webberanalytics@...> wrote:
          >
          > > **
          > >
          > >
          > > Hi All,
          > >
          > > Can anyone give me a quick 101 on regex in GA? Essentially I'd like to
          > > create a URL goal regular expression match for any pages that contain these
          > > 2 phrases in the URL: product and cart
          > > Essentiall my logic is give me any URLs where the URL contains both
          > > 'product' AND 'cart'.
          > >
          > > Help!
          > >
          > > Thanks
          > >
          > > [Non-text portions of this message have been removed]
          > >
          > >
          > >
          >
          >
          > [Non-text portions of this message have been removed]
          >
        • WebberAnalytics Smith
          That worked perfectly, thank you Ana! [Non-text portions of this message have been removed]
          Message 4 of 9 , Sep 13, 2012
          • 0 Attachment
            That worked perfectly, thank you Ana!


            [Non-text portions of this message have been removed]
          • WebberAnalytics Smith
            As a follow up to my original regex question, (I ve googled this and have not been successful!) How do I build a regex for all pages that contain product but
            Message 5 of 9 , Sep 24, 2012
            • 0 Attachment
              As a follow up to my original regex question, (I've googled this and have
              not been successful!)
              How do I build a regex for all pages that contain 'product' but NOT any
              pages that contain 'product123'? Essentially I want all goal URLs in GA to
              give me anything with 'product' but exclude the ones with 'product123'.

              Is this possible in GA goals?

              Thanks!

              On Wed, Sep 12, 2012 at 8:25 PM, WebberAnalytics Smith <
              webberanalytics@...> wrote:

              > Hi All,
              >
              > Can anyone give me a quick 101 on regex in GA? Essentially I'd like to
              > create a URL goal regular expression match for any pages that contain these
              > 2 phrases in the URL: product and cart
              > Essentiall my logic is give me any URLs where the URL contains both
              > 'product' AND 'cart'.
              >
              > Help!
              >
              > Thanks
              >


              [Non-text portions of this message have been removed]
            • ju2ltd
              Try this: ^(?!.*123).*product.*$ Jim.
              Message 6 of 9 , Sep 25, 2012
              • 0 Attachment
                Try this:

                ^(?!.*123).*product.*$

                Jim.

                --- In webanalytics@yahoogroups.com, WebberAnalytics Smith <webberanalytics@...> wrote:
                >
                > As a follow up to my original regex question, (I've googled this and have
                > not been successful!)
                > How do I build a regex for all pages that contain 'product' but NOT any
                > pages that contain 'product123'? Essentially I want all goal URLs in GA to
                > give me anything with 'product' but exclude the ones with 'product123'.
                >
                > Is this possible in GA goals?
                >
                > Thanks!
                >
                > On Wed, Sep 12, 2012 at 8:25 PM, WebberAnalytics Smith <
                > webberanalytics@...> wrote:
                >
                > > Hi All,
                > >
                > > Can anyone give me a quick 101 on regex in GA? Essentially I'd like to
                > > create a URL goal regular expression match for any pages that contain these
                > > 2 phrases in the URL: product and cart
                > > Essentiall my logic is give me any URLs where the URL contains both
                > > 'product' AND 'cart'.
                > >
                > > Help!
                > >
                > > Thanks
                > >
                >
                >
                > [Non-text portions of this message have been removed]
                >
              • WebberAnalytics Smith
                When I try this, I get the below error in GA: One or more of the services on which we depend is unavailable. Please try again later after the service has had a
                Message 7 of 9 , Sep 27, 2012
                • 0 Attachment
                  When I try this, I get the below error in GA:
                  One or more of the services on which we depend is unavailable. Please try
                  again later after the service has had a chance to recover.

                  Is this not supported in GA?


                  [Non-text portions of this message have been removed]
                • WebberAnalytics Smith
                  I am also trying this which I found in a google search: ^[^?]*+(?
                  Message 8 of 9 , Sep 27, 2012
                  • 0 Attachment
                    I am also trying this which I found in a google search:
                    ^[^?]*+(?<!123).*?product.*$
                    But still getting an error. Any ideas why this won't work?

                    Thanks

                    On Thu, Sep 27, 2012 at 9:47 AM, WebberAnalytics Smith <
                    webberanalytics@...> wrote:

                    > When I try this, I get the below error in GA:
                    > One or more of the services on which we depend is unavailable. Please try
                    > again later after the service has had a chance to recover.
                    >
                    > Is this not supported in GA?
                    >


                    [Non-text portions of this message have been removed]
                  • anakravitz
                    These are failing because negative lookaheads aren t supported in GA s implementation of regex. Therefore to make this work you ll be better off being more
                    Message 9 of 9 , Sep 27, 2012
                    • 0 Attachment
                      These are failing because negative lookaheads aren't supported in GA's implementation of regex.

                      Therefore to make this work you'll be better off being more specific about the pattern that DOES match, so that you naturally exclude those patterns that don't. For example, product$ would capture all URLs that end with "product" and would therefore exclude "product123". Of course this won't work if you are also trying to include product456, so the correct regex will depend on your URL structure and required logic.

                      Another approach is to rewrite the original URLs with virtual page views, so you can avoid messing around with complicated regex.

                      Ana
                      www.akravitz.com

                      --- In webanalytics@yahoogroups.com, WebberAnalytics Smith <webberanalytics@...> wrote:
                      >
                      > I am also trying this which I found in a google search:
                      > ^[^?]*+(?<!123).*?product.*$
                      > But still getting an error. Any ideas why this won't work?
                      >
                      > Thanks
                      >
                      > On Thu, Sep 27, 2012 at 9:47 AM, WebberAnalytics Smith <
                      > webberanalytics@...> wrote:
                      >
                      > > When I try this, I get the below error in GA:
                      > > One or more of the services on which we depend is unavailable. Please try
                      > > again later after the service has had a chance to recover.
                      > >
                      > > Is this not supported in GA?
                      > >
                      >
                      >
                      > [Non-text portions of this message have been removed]
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.