8

I'm setting up some conversion funnels on Google Analytics. One is to analyse traffic going from the main site to a secondary promotional site running on a virtual directory (on the same domain though)

I should add, this is a setup form in Google Analytics, I can't using another other code (PHP, JS, C# etc) and it has to be done in one step

So for example something like:

  • /default.aspx or /directory/default.aspx or /somedirname/default.aspx
  • [to >]
  • /promotion/default.aspx

In regular expression land, this would be:

  • ^/(?!promotion)(.*).aspx
  • [to >]
  • ^/promotion/(.*).aspx

The problem is Google Analytics no longer supports negative lookaheads, so the regexp ^/(?!promotion)(.*).aspx fails. (Reference here, first reply)

Is there another way I can do this?

Many thanks.

Darren
  • 170
  • 1
  • 7

1 Answers1

7

You could do a two-step approach (whether that's possible in Analytics, I have no idea, though):

  1. Replace unconditionally:
    /(.*\.aspx) --> /promotion/$1
  2. Replace again:
    /promotion/promotion/(.*) --> /promotion/$1

If all else fails:

^/(?:[^p]|p[^r]|pr[^o]|pro[^m]|prom[^o]|promo[^t]|promot[^i]|promoti[^o]|promotio[^n])/(.*)\.aspx
Tomalak
  • 332,285
  • 67
  • 532
  • 628
  • 2
    thanks Tomalak, but it can only be done in one step, using only regular expressions :( – Darren Oct 08 '09 at 15:06
  • 1
    The "all else fails" version did the trick for me... super annoying that (?!...) doesn't work though! – Nick B Apr 29 '13 at 20:15