Current User: Guest Login
Please consider registering


Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Extracting ID from URL

Reply to Post Add a New Topic
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 1125

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

Guest Name (Required):

Guest Email (Required):

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

Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
2 + 7
   


About the InternetOfficer.com Forum

Forum Timezone: UTC 1

Most Users Ever Online: 302

Currently Online:
9 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 2
Forums: 9
Topics: 638
Posts: 2712

Membership:

There are 257 Members
There have been 305 Guests

There is 1 Admin
There is 1 Moderator

Top Posters:

cssfsu – 55
deepakgupta – 34
albert_newton – 30
cosminpana – 20
DTNMike – 19
ahtshun83 – 17

Recent New Members: raju, todd2taylor, sbdcunha, mansigill1987, ThomasDuh, ThomasKic

Administrators: Jean-Luc (1125 Posts)

Moderators: Jean-Luc (1125 Posts)