Extracting ID from URL


 

Current User: Guest Login Register
Please consider registering

Search 
Search Forums:


 




Extracting ID from URL

Add a New Topic 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 220

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})"


Add a New Topic 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: 3 + 6        (Required)

Topic Reply:


 

WebStats1


About the InternetOfficer.com forum

Currently Online:

1 Guest

Maximum Online: 20

Forums:

Groups: 2

Forums: 7

Topics: 104

Posts: 493

Members:

There are 26 members

There are 94 guests


Jean-Luc has made 220 posts

Top Posters:

Steve - 14

angelko - 4

cwei - 4

Kinglui - 3

vtroymck - 3

Administrator: Jean-Luc | Moderators: Jean-Luc


© Simple:Press Forum - Version 3.1.2 (Build 340)