homepage Welcome to WebmasterWorld Guest from 54.242.140.11
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / WebmasterWorld / Website Analytics - Tracking and Logging
Forum Library, Charter, Moderators: Receptional & mademetop

Website Analytics - Tracking and Logging Forum

    
Google Analytics Question
Can we track what keywords convert to sales using google analytics?
seoindore

5+ Year Member



 
Msg#: 4460712 posted 11:25 am on Jun 2, 2012 (gmt 0)

Hello everyone,

I would like to know if it is possible with Google analytics to track what search term may have made the sale. Probably an easy thing but banging my head against the wall.

 

toplisek

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4460712 posted 1:23 pm on Jun 2, 2012 (gmt 0)

Some use PHP like suggested:
[warriorforum.com...]

and man websites use hidden values in the form:

<input type="hidden" name="keyword" value="<?php echo $_COOKIE['keyword']; ?>" />

Replacing "keyword" with your actual field and cookie names
<?php
session_start();
if(!$_SESSION['referer'])
{

$URL = $_SERVER['HTTP_REFERER'];
//first see if the url contains google
if(($pos = strpos($URL, 'google'))||($pos = strpos($URL, 'msn'))||($pos = strpos($URL, 'bing')))
{
// get everything after the q=
$query=strstr($URL, "q=");

$array=explode('&', $query); // get rid of everything after the first &

foreach ($array as $param)
{
if ($param{0} == 'q') // its q, so it's either google or msn/bing
{
$word_string = substr($param, 2); // strip q=
}
}

$keywords = str_replace('"', '', urldecode($word_string)); //clean keywords, get rid of the + and quotes

$_SESSION['referer'] = $URL; // set the url in the session

if($keywords){ $_SESSION['keywords'] = $keywords; } // set the keywords in the session
}
elseif($pos = strpos($URL, 'yahoo'))
{
// get everything after the p=
$query=strstr($URL, "p=");

$array=explode('&', $query); // get rid of everything after the first &

foreach ($array as $param)
{
if ($param{0} == 'p') // its a p so its yahoo
{
$word_string = substr($param, 2); // strip the p=
}
}

$keywords = str_replace('"', '', urldecode($word_string)); //clean keywords, get rid of the + and quotes

$_SESSION['referer'] = $URL; // set the url in the session

if($keywords){ $_SESSION['keywords'] = $keywords; } // set the keywords in the session
}
else
{
//not one of the 3 search engines so just hold the URL
$_SESSION['referer'] = $URL;
}
}
?>

netmeg

WebmasterWorld Senior Member netmeg us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 4460712 posted 5:02 pm on Jun 4, 2012 (gmt 0)

Or you can set up a profile with filters to show you, which is what I do.

First of all, set up a new profile (because if you make a typo, you don't want to mess up your existing data) I call mine Transactions to Keywords. Make sure it's set up for ecommerce and is tracking conversions.

Then you need to create three filters, and apply them to the new profile. They MUST be done in the order they appear here - one, two and three. Once this done, you can go into the ecommerce section of this profile under transactions, and the source/medium for each transaction will be right there with the order number. Including the keyword, if it's available.

Filter #1:

Select Custom Filter
Select Advanced

Field A -> Extract A
Select E-Commerce Transaction ID from the dropdown, and add (.*) to the next field.

Field B -> Extract B
Select Campaign Source from the dropdown, and (.*) for the next field.

Output To -> Constructor
Select E-Commerce Transaction Id from the dropdown, and $A1 - $B1 in the next field

Yes Yes Yes and No for the radio buttons and save.

Filter #2

Select Custom Filter
Select Advanced

Field A -> Extract A
Select E-Commerce Transaction ID from the dropdown, and add (.*) to the next field.

Field B -> Extract B
Select Campaign Medium from the dropdown, and (.*) for the next field.

Output To -> Constructor
Select E-Commerce Transaction Id from the dropdown, and $A1 ($B1) in the next field

Yes Yes Yes and No for the radio buttons and save.

Filter #3

Select Custom Filter
Select Advanced

Field A -> Extract A
Select E-Commerce Transaction ID from the dropdown, and add (.*) to the next field.

Field B -> Extract B
Select Campaign Term from the dropdown, and (.*) for the next field.

Output To -> Constructor
Select E-Commerce Transaction Id from the dropdown, and $A1 - $B1 in the next field

Yes Yes Yes and No for the radio buttons and save.

Make sure all three filters are applied in the exact order, and wait till you have a few transactions to see what you get.

seoindore

5+ Year Member



 
Msg#: 4460712 posted 5:16 am on Jun 5, 2012 (gmt 0)

Thanks a lot #toplisek and #netmeg.

#toplisek - I am not much familiar with the programing/coding. But definitely ask my developer to try the process that you have mentioned.

#netmeg - I'll try the procedure & will let you know the results.

Again thanks a lot guys for giving your valuable suggestions.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Website Analytics - Tracking and Logging
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved