用于动态URL目标设置的RegEx [英] RegEx for Dynamic URL Goals settings

查看:69
本文介绍了用于动态URL目标设置的RegEx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试使用此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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆