Extracting ID from URL


 

Current User: Guest Login Register
Please consider registering

Search 
Search Forums:


 




Extracting ID from URL

Reply to Post
UserPost

5:17 am
April 29, 2008


Cylindric

Guest

Hello,

I'm trying to extract an ID from a URL, so that when a page (from a CRM) is called from different places, with slightly different URLs, they are grouped together in the stats.

A typical URL looks like this:

“GET /component/option,com_events/task,view_detail/agid,662/ year,2008/month,06/day,02/Itemid,125/”

Everything after the “agid,662″ varies depending on the page, it's just the “662″ I want to pull out

I've tried the following:

ExtraSectionName1="Events pages"
ExtraSectionCodeFilter1="200 304"
ExtraSectionCondition1="URL,\/component\/option,com_events\/task,
view_detail\.*"
ExtraSectionFirstColumnTitle1="Event ID"
ExtraSectionFirstColumnValues1="URL,.*agid,(.d)/.*"
ExtraSectionFirstColumnFormat1="%s"
ExtraSectionStatTypes1=PL
MaxNbOfExtra1=100
MinHitExtra1=1

But nothing is ever returned, my section is always empty.

5:29 am
April 29, 2008


Jean-Luc

Admin

posts 191

Try this:

ExtraSectionFirstColumnValues1="URL,\/agid,([0-9]+)\/*"

6:06 am
April 29, 2008


Cylindric

Guest

Brilliant thanks! Almost perfect - I just made a slight change to it so that it shows the ID's, and it's spot-on. (I'll probably eventually change the final Format so it shows them as links)

To recap for future searchers:

When the URL is like

/component/option,com_events/task,view_detail/agid,588/

year,2008/month,05/day,07/Itemid,811/

/component/option,com_events/task,view_detail/agid,62/

year,somethingelse/

/component/option,com_events/task,view_detail/agid,1/

year,2007/month,04/day,01/Itemid,812/

/component/option,com_events/task,view_detail/agid,431/

year,2006/month,08/day,16/Itemid,6/

Find the ones that are “event views”:

ExtraSectionCondition1="URL,\/component\/option,

com_events\/task,view_detail\.*"

And pull out the “AGID”:

ExtraSectionFirstColumnValues1="URL,\/agid,([0-9]{1,4})"

Reply to Post


Reply to Topic: Extracting ID from URL

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 10 + 6        (Required)

Topic Reply:


 

WebStats1


About the InternetOfficer.com forum

Currently Online:

1 Guest

Maximum Online: 19

Forums:

Groups: 2

Forums: 7

Topics: 87

Posts: 428

Members:

There are 10 members

There are 84 guests

Jean-Luc has made 191 posts

Top Posters:

Steve - 14

cwei - 4

KevinA - 3

vtroymck - 3

knonymouse - 2

Administrator: Jean-Luc


© Simple:Press Forum - Version 3.0.2 (Build 318)