Forum Moderators: buckworks & skibum

Message Too Old, No Replies

Tracking adsense in my logs

         

wheel

9:22 pm on Mar 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know this is rudimentary but I'm not finding the right Google search term.

How can I tell in my existing logs,
- what the search term was that generated the ad
- whether it was adsense or organic

I know I get something like google.com/search?search term here , but I don't know if that's strictly organic. And I'd like to pull all the lines from my log, seperate into organic and ppc and then look at the search terms.

smallcompany

6:26 pm on Mar 14, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Run a query and pick a link from PPC ad, and from organic search result.

Also, visit a site with AdSense and pick a link from an ad there.

Be aware that AdSense does not provide a search term, as there is no one, unless it was AdSense powered search.

What I could see:

- if it's organic, it carries variables like "source=web", and obviously "q=queryterm"
- if it's PPC, it does not have "source", but "q" only, and it also has "gclid" which will show up only if you have additional tracking turned on for the purpose of GA.
- Not sure about AdSense, check the URL.

Now, be aware that when you grab a shortcut from Google ad, being that regular search PPC or AdSense, URLs are different than those when you actually click onto the link and what gets written down in your server logs.

For example, when you pick a link from search ad, there is no "gclid" there. But if you click onto it, you'll find it in your server logs.
You can checj this if you use IE, click onto the link, and then go to "View", and then "Webpage Privacy Policy". You'll see there how link goes from one to another form, and GCLID will be there.

Now, the hard part is how you analyze your logs.

If you're good in programing, you may be able to separate them into different log files at the time of their writing.
I have no clue if this is possible and how to do it. This may be a good question for other thread. I'll ask it in Apache.

The other way would be to have regular logs, and use some powerful notepad type of the program that is able to separate stuff, or even better, to use a good server web log analytical program that gives you an option to filter by various variables.
I know that in many you can opt for not to see all calls but pages only for example.

Hope this helps.

SteveWh

6:20 am on Mar 15, 2010 (gmt 0)

10+ Year Member



Nice idea. For the log analysis, the grep utility (included with Linux, but also available for Windows) should be able to do this better than a log analysis program. Windows also has a built-in command line utility called findstr that's similar to grep but not as capable.

Determine the regular expression that identifies organic referrals, and one that identifies PPC, and whatever else you want. Then create a Linux bash script or Windows/DOS .bat file with something like this:

grep -i -P "OrganicRegExp" YourLogFile.txt > OrganicReferrals.txt
grep -i -P "PPCRegExp" YourLogFile.txt > PPCReferrals.txt
etc.

-i means case insensitive, if that's what you want
-P means you can use Perl regular expressions, more flexible than normal regex

OrganicReferrals.txt will contain lines that matched the organic regex. PPCReferrals.txt will contain lines that matched the PPC regex. YourLogFile.txt remains unchanged.

wheel

2:07 pm on Mar 15, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks smallcompany and SteveWh! Those two responses are above and beyond, they've saved me a couple hours of reading and testing. I really appreciate the help.