Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3786204
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:38:48+00:00 2026-05-19T11:38:48+00:00

I have two URLs (actually more because Google has Maps, News, Images etc.) Google

  • 0

I have two URLs (actually more because Google has Maps, News, Images etc.)
Google Organic search:

http://www.google.nl/#hl=nl&biw=1920&bih=965&q=koffie&aq=f&aqi=g10&aql=&oq=&
fp=b8a3028139d33c34`

and Google Adwords search:

http://www.google.nl/aclk?sa=L&ai=CZYun1fI3TY_hO8aMOrer6aQCmK2m2AGIpdyCFr_g_-RVE
AEoCFDytZmR-_____8BYJGkmoWEGMgBAakCkm-p2E6Ttj6qBBlP0O_GI1GZU09CYDd728FmO_QIDea76u
yT&num=1&sig=AGiWqtzxvt17KyOWqEkwJ7jVdanxR645tw&
adurl=http://ad-emea.doubleclick.net/clk%3B233218340%3B57152064%3Bv

I need a regex to find google in a URL and exclude the aclk? part. This is only used by Google Adwords. The regex will be used to filter from the host referrer and find only Google Organic traffic.

First I tried this regex:

www[.]google[.].{1,}client=|www[.]google[.].{1,}gs_rfai|www[.]google[.].{1,}&
prmd|news[.]google[.].{1,}nwshp?| video[.]google|www[.]google[.].{1,} imghp?|
www[.]google[.].{1,}imgres|www[.]google[.].{1,}search

This caught 50% of the traffic. At that time we didn’t have Adwords running, so it could’ve caught all traffic. But it didn’t.

We want to catch all Google (organic) URLs and exclude Adwords URLs (with the aclk? ).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:38:49+00:00Added an answer on May 19, 2026 at 11:38 am

    If you need to separate out the domain name from the rest of the URL, consider using a URL parser. There’s one in Ruby’s standard library.

    Ok, here’s some code:

    require "uri"
    uri ="http://www.google.nl/aclk?sa=L&ai=CZYun1fI3TY_hO8aMOrer6aQCmK2m2AGIpdyCFr_g_-RVEAEoCFDytZmR-_____8BYJGkmoWEGMgBAakCkm-p2E6Ttj6qBBlP0O_GI1GZU09CYDd728FmO_QIDea76uyT&num=1&sig=AGiWqtzxvt17KyOWqEkwJ7jVdanxR645tw&adurl=http://ad-emea.doubleclick.net/clk%3B233218340%3B57152064%3Bv"
    
    puts URI.split(uri).inspect
    

    gives

    ["http", nil, "www.google.nl", nil, nil, "/aclk", nil, "sa=L&ai=CZYun1fI3TY_hO8aMOrer6aQCmK2m2AGIpdyCFr_g_-RVEAEoCFDytZmR-_____8BYJGkmoWEGMgBAakCkm-p2E
    d728FmO_QIDea76uyT&num=1&sig=AGiWqtzxvt17KyOWqEkwJ7jVdanxR645tw&adurl=http://ad-emea.doubleclick.net/clk%3B233218340%3B57152064%3Bv", nil]
    

    You probably want to call split on the long string (use “&” to split them up, and then split those things up using “=”) if you want the parameters. Sorry if I’m not too precise here, I didn’t fully understand your question.

    The rdoc for URI is at http://www.ruby-doc.org/stdlib/libdoc/uri/rdoc/ . Click on “URI” to see the main documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two urls: url1 = http://127.0.0.1/test1/test2/test3/test5.xml url2 = ../../test4/test6.xml How can I get
I am working on existing project. I have following two URLs http://example.dev/en/course/myUserName/myCourseName/150/myChapterName/1016/page/1/?hcid=147 http://example.dev/en/course/myUserName/myCourseName/150/myChapterName/1016/page/2/?hcid=147 2nd
I have two URLs with parameters http://localhost:8041/Reforge.aspx?name=CyanГ http://localhost:8041/Reforge.aspx?name=Cyanì In first URL Firefox encodes last
I have two types of urls: http://mydomain.com/npguar/en/products.php http://mydomain.com/npguar/en/1/product_specification.php Earlier I was using this .htaccess
There are two URLs I have: http://localhost:65043/home/create/ http://localhost:65043/home/create/2 I want to check that the
I have two URLs: http://s140452.gridserver.com/view-pullsheet/ https://s140452.gridserver.com/locations/ When browsing through any properties on the locations
I have two tables with list of urls fetched from different sources. I want
So basically, I have two fast questions about kohana urls. 1) With default .htaccess
Backround: Suppose I have the following Git URLs (hosted on github) http://github.com/mikl/drupal.git git://github.com/mikl/drupal.git (Git
What I'm trying to achieve here is lets say we have two example URLs:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.