Forum
Community Login
Infusionsoft Community
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Google Keywords in Infusion and 3rd party cookies (1 viewing) (1) Guests
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Google Keywords in Infusion and 3rd party cookies
#6183
StephenB87 (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Google Keywords in Infusion and 3rd party cookies 5 Months, 1 Week ago Karma: 0  
Hello All,

I followed the process described here: http://www.infusionblog.com/company-info/infusion-crm-and-analytics/ to get the listed information (less the Click History) into our infusion account for leads we generate of various landing pages. This works like a charm in Fire Fox (which allows 3rd party cookies) but in IE essentially all the values are blank, save for the leadsource value which we are passing ourselves via the querystring.

To test this I submitted myself after clicking one of our PPC links in google and checked the data, all blank save for the leadsource. This was done with IEs default settings. Next I cleared out my cookies and cache and allowed 3rd party cookies. Then I repeated the process and the values came thru.

Does anyone have a work around or know of any way to get the keywords out of Google the majority of the time?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#6193
JManna (Admin)
Admin
Posts: 794
graph
User Online Now Click here to see the profile of this user
Re:Google Keywords in Infusion and 3rd party cookies 5 Months, 1 Week ago Karma: 22  
An update to that blog post was published more recently by Tyler this year at http://www.infusionblog.com/infusionsoft-insider/advanced-website-tracking-with-infusionsoft/ .


I'm not sure about why this happens, but I'll see what he thinks. Thanks for posting it here for help, Stephen.

~Joe
 
Report to moderator   Logged Logged  
 
__________________________
Joseph Manna
- Infusionsoft | Community Manager
- joseph.manna@infusionsoft.com
- http://community.infusionsoft.com/

Check out our excellent resources for getting help and support at the FuseBox!

- Stay up to date on the latest Infusionsoft, Small Business and Marketing posts on the Infusionsoft Blog!
  The administrator has disabled public write access.
#6197
tgarns (Admin)
Admin
Posts: 107
graphgraph
User Online Now Click here to see the profile of this user
Re:Google Keywords in Infusion and 3rd party cookies 5 Months, 1 Week ago Karma: 15  
There shouldn't be any problems with IE. The cookies are not 3rd party cookie. Google analytics creates cookies on your site's domain. Something else must be going wrong.

Wanna share some code?
 
Report to moderator   Logged Logged  
 
Tyler Garns
Director of Marketing
Infusion Software
  The administrator has disabled public write access.
#6199
StephenB87 (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Re:Google Keywords in Infusion and 3rd party cookies 5 Months, 1 Week ago Karma: 0  
Tracking the individual pages that a visitor goes to isn't really what were going for here. The code I'm using is in the link I provided in the original post save for changing a couple spots. $_REQUEST['ls'] to $_REQUEST['ref'] which is the value we pass to track which adwords campaign the lead came from. I also commented the section that sets up the clickhistory cookie and value. Also, the section that gathers the keywords I altered as follows:

Code: :

 $info explode("|",$_COOKIE['__utmz']); $ga_info = array(); foreach ($info as $val) {     $temp explode("=",$val);     $ga_info[$temp[0]] = $temp[1]; } $keys = (!isset($ga_info['utmctr'])) ? (isset($_GET['OVRAW'])) ? $_GET['OVRAW'] : "Uknown" $ga_info['utmctr']; setcookie("Keywords"$keystime()+100000000"/"$domain);



The $_GET['OVRAW'] is the value that contains the keyword for Yahoos adword campaigns

Let me elaborate on whats going on:

We have a series of landing pages, at the moment 3, that have specific adword campaigns. Each page is themed towards a certain grouping of keywords, which are in use on the adwords campaign. What were looking to do is gather the keyword the user searched on in google and put that into some custom fields for the contact. The script found in the blog I linked in the original post with the tweaks I made works just fine in browsers that don't block 3rd party cookies such as Fire Fox. However if I use a browser that does block 3rd party cookies such as IE the value is captured as "unknown" which if you refer to the above code is used when Googles utmctr and Yahoos OVRAW values are not present. I can see that the cookies are set as belonging to our sites domain, however it wasn't set by our site and I do think IE will still regard that as 3rd party, right?

Still looking for a reliable way to get the exact keyword searched on google into infusion.
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/06/12 16:35 By StephenB87.
  The administrator has disabled public write access.
#6259
StephenB87 (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Re:Google Keywords in Infusion and 3rd party cookies 5 Months, 1 Week ago Karma: 0  
Hello all,

I have found out what was causing the issue and come up with a solution. The cookies were not 3rd party, however I found that PHP is not able to read a cookie immediately after it is set. You have to browse to another page on the site or refresh the page before they become available. To get around this I used some javascript to grab the __utmz cookie and check it for the key word.

I use a script written by Michael Harrison called Google Analytics Keyword Sleuth which checks the referrer for a variety of values in the query string of the referring site (in the case of myself: Google / Yahoo / MSN). I did a few small tweaks to this script as well as adding a separate check in a javascript function that is called via the _onload_ attribute on the tag. Here is the code for anyone that is having a similar problem to mine.

The Google Analytics Keyword Sleuth: (ga_keyword.js)

Code: :

  var keyword null; function noPercent(x) {     unescape(x);     return x.replace(/\+/g," ").replace(/^\s\s*/, '').replace(/\s\s*$/, ''); } function getRef() {     ref document.referrer;     re = /(\?|&)(q|p|query|encquery|qt|terms|rdata|qs|wd|text|szukaj|k|searchExpr|search_for|string|search_query|searchfor)=([^&]+)/;     searchq re.exec(ref);     if(searchq) {         searchq[3] = noPercent(searchq[3]);         keyword searchq[3];         sleuthTracker._setVar(searchq[3]);     }     else {         sleuthTracker._setVar('Referral: ' document.referrer);         keyword document.referrer;     } } function sleuth() {     if(document.location.search.indexOf("gclid")!=-1||document.location.search.indexOf("cpc")!=-1) {         getRef();     } } var sleuthTracker _gat._getTracker("UA-1"); sleuthTracker._initData(); sleuth();



Please note I removed the comments as they seemed to break the post

Here is my check that is called via the _onload_ attribute of the tag

[code:2]
function checkKey() {
if (keyword != null ) { document.getElementById("keyword").value = keyword; }
var utm = getCookie('__utmz');
if (utm.length>0) {
ctr_start = utm.indexOf("utmctr=");
if (ctr_start != -1) {
ctr_start = ctr_start + 7;
ctr_end = utm.indexOf("|",ctr_start);
if (ctr_end == -1) ctr_end = utm.length;
document.getElementById("keyword").value = utm.substring(ctr_start,ctr_end);
}
}
}

function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
[/code:2]

And a bit of PhP to read the cookie if it is present to hopefully have something captured even if javascript is disabled.

[code:3]
$info = explode("|",$_COOKIE['__utmz']);
$ga_info = array();
foreach ($info as $val) {
$temp = explode("=",$val);
$ga_info[$temp[0]] = $temp[1];
}
$keys = (!isset($ga_info['utmctr'])) ? (isset($_GET['OVRAW'])) ? $_GET['OVRAW'] : "Uknown" : $ga_info['utmctr'];
[/code:3]

*The $_GET['OVRAW'] value is how Yahoo passes the searched keyword

And the HTML form field (my custom field is called "Keyword")

[code:4]

[/code:4]

Hope that helps anyone that ran into the same problem as myself.
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/06/16 14:04 By StephenB87.
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop