用于动态URL目标设置的RegEx [英] RegEx for Dynamic URL Goals settings
问题描述
我已经尝试使用此RegEx在GA中设置目标2天,但是我无法解决这个问题...
I have tried to work this RegEx to set up a goal in GA for 2 days, but I cannot get my head around it...
URL格式如下:
/purchase.php?cDd=1&transaction_id=xxxxxxx&verify=xxxxxxxxxxxxxxxx=&method=creditcard&type=purchase
transaction_id =填充了一个数字
verify=
由一串数字,大写字母和小写字母组成
transaction_id= is populated with a sept of numbers
verify=
is populated by a string of numbers, letters in both caps and lower case
基本上,我只想匹配以&method=creditcard&type=purchase
Basically I would like to only match URLs which finish by &method=creditcard&type=purchase
我尝试只放入&method=creditcard&type=purchase
,但是它也检索其他URL.
I have tried to just put &method=creditcard&type=purchase
but it does retrieve other URLs too.
推荐答案
在正则表达式的末尾放置一个$
符号.
Put a $
sign at the end of your regex.
这样,您可以强制只匹配以&method=creditcard&type=purchase
This way you enforce to only match url's that end with &method=creditcard&type=purchase
^/purchase.php\?cDd=1&transaction_id=[0-9]*&verify=[a-zA-Z0-9]*=&method=creditcard&type=purchase$
或
&method=creditcard&type=purchase$
可以解决问题
这篇关于用于动态URL目标设置的RegEx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!