tags:

views:

15

answers:

2

I need to do a huge replacement on my site 400+ items with the new asynchronous tracking.

pageTracker._trackEvent('footer_search', 'search', 'search-footer');

Im using aptana and it has a regex replacement, it needs to look like this, notice the [ ].

_gaq.push(['_trackEvent', 'footer_search', 'search', 'search-footer']);

Much appreciated!

+2  A: 

Try

search for

pageTracker._trackEvent\('([A-Za-z0-9-_]+)', '([A-Za-z0-9-_]+)', '([A-Za-z0-9-_-]+)'\);

replace with

_gaq.push(['_trackEvent', '$1', '$2', '$3']);
Brad
+2  A: 

Hopefully you can see where I'm going with this.

pageTracker\.([^\(]+)\(([^\)]+)\)

_gaq.push(['$1', $2]);
Joe