Passing Google Analytics Variables Through Javascript?
-
Alright so here's my situation and hopefully someone can help...
I want to be able to pass Google Analytics variables onto my affiliate links so I have some better conversion tracking data (not PPC traffic so no easy dynamic keyword insertion variables).
I want to do something like this:
User searches "keyword" in Google > User lands on mysite.com > search data is assigned to global variables that I can use in my affiliate link redirect script.
afflink.com/?id=123&keyword=[GA keyword variable]
Anybody know how I would go about doing that? I've seen other Non-GA tracking scripts do this but I can't figure it out here and it's driving me crazy!
Thanks,
DrewEDIT: Just figured it out after a lot of guess and testing... I'm not sure if the way I'm doing it is the fastest, most optimized way but it works.
Solution: I can pull the GA cookie and break it down to retrieve the keyword using PHP. For anyone searching for this in the future, here's how I did it:
$gacookie = $_COOKIE['__utmz'];
$keyword = substr(strstr($gacookie, 'utmctr='),7);?>
Then I can use the $keyword variable wherever I need it. I haven't actually tested this on a live site yet but everything is working fine as of right now.
If anyone has a better solution please feel free to answer.
-
I'm not sure if this is what you mean..
You want the keyword from a google search to show up on your afflink?
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Will i able to rank in google of i rephrase amazon product description?
Please guide me if I rephrase the information given on Amazon and write a unique article. Will my post rank in Google?
Affiliate Marketing | | Hmzashk512141 -
Does Canonical Tag passes link juice to the original URL?
We are using Canonical tags at almost all the pages of our eCommerce website. We have various sorting options like "High to Low", "Best Sellers", etc., due to this page URLs get change with some dynamic URL parameters. To avoid duplicity, we are using canonical tag on each page which point to the original url. Also, we are using IBM Coremetrics to track traffic and conversions, but to measure referral traffic in Coremetrics, we have to add tracking parameters in the URL. So, while link building we need to share URLs with Coremetrics tracking parameters in the URL, but the canonical of this page is pointing to the original URL. Suppose we have a Page that needs to be shared with Coremetrics tag: domain.com/category-name/?cm_mmc=Referral_-xyz--izUPF8VmRng--3 This Page has the canonical tag pointing to the original url: domain.com/category-name/ My question is if the URL: domain.com/category-name?cm_mmc=Referral_-xyz--izUPF8VmRng--3 got shared on other websites, will it pass link juice to the original URL: domain.com/category-name.
Affiliate Marketing | | Ramendra.Singh0 -
Affiliate URLs Indexed in Google
We have an active in-house affiliate program which has a create-a-link function where affiliate, as in most affiliate programs, can build links back to our content to produce sales. The problem that I am seeing is that some of the affiliate URL versions are being indexed in Google rather than the original page. For instance.. http://www.ourdomain.com/page_start.aspx?affnum=F025212&Start_Page=RaceCar&referrer=createlink is outranking... http://www.ourdomain.com/racecar This presents 2 issues for us. First, this presents duplicate content issues obviously. Second, we pay our affiliates a portion of the sales so, in order to maximize profitability, we'd like the indexed pages to be the original version. What's the best way to handle this? I want to make sure that affiliates continue to get credit for links from their sites but search engine links should go to the original versions.
Affiliate Marketing | | ATIseo0 -
Google Analytics Tracking Pixels for Third-Party sites???
Hello, Does anyone know if it is possible to track an event on a third party site and have it post back to your Google Analytics account? For example, I am sending traffic to a partners site and I want to know if that traffic I am sending them will hit a specific point of conversion (a sale) and I'm wondering if it possible to place a tracking pixel on their thankyou.html page that gets recorded in my google analytics?
Affiliate Marketing | | shawn810 -
How accurate is google analytics?
I have a new site that has just entered the SERPS so I'm tracking stats pretty carefully using google analytics. Yesterday according to my affiliate stats I had 10 unique visits with 2 sign ups for one of my products but google analytics only shows a total of 5 visitors yesterday on my site? ( A 20% conversion rate 2 out of 5 also seems ridiculously high). I'm guessing there were also a number of users that visited my site but didn't click through one of the affiliate links and just browsed the site so the visitor number could be higher? I'm not sure where this huge discrepancy comes from?
Affiliate Marketing | | SamCUK0 -
Did Something Happen With Google's Algo On 06/09/2011?
Yesterday, June 9th, I wokeup and ran my rank checking software. My two domains that I have page one number one rankings for are solid as they have been for the last year. Before I went to sleep last night I ran the rank check again, and had lost all rankings. After researching into it more, I realized my entire domain name is deindexed. The site: search yields no results at all. The domain name has links from over 250 root domain names, is highly focused on one product and one keyword. The links come mostly from articles, comments, forum posts, press releases, and 3-4 articles that were posted talking about my website by other bloggers. The site has 60 pages, which I think (thought) was more than enough for such a tight focus. The domain is a good keyword match name that I paid a grand for. In webmaster tools it says my URLs are still indexed, however thats not the case. I tried searching in Bing, and Yahoo. Bing - DeIndexed. Yahoo - One page of the site indexed. I havent done anything black hat at all, which is ironic this domain was banned because its the only domain name links were built to using a respectable seo company. It runs on wordpress, and I had not added any new content in about 4 months. PR4, and the PR still exists in the toolbar and on the websites I used to check it. Also tried searching google.fr, google.ru, etc... to see if it was a complete deindex, and it is. Then used the multiple datacenter check - which told me my domain name was not listed in any of the DCs checked. It is an affiliate website, with one affiliate link on the homepage. I use a plugin to mask the link so it appears as /starthere/ rather than a long affiliate URL. There is ONE catch, this website is in the pharmacy niche. Now before you all go saying oh well thats why, consider my question. I dont sell anything illegal, nor does the affiliate program I promote. I collect traffic from people searching for a prescription drug and then recommend a herbal alternative. Something odd however, is that I have 5 websites like this. Each tailored to their respective prescription drug backlink wise, and then on site I have comparisons and explain the benefits of instead using one of the herbal products or OTC supplements from savon/walgreens whatever. The other 4 websites gained rank, pages 1, 2, and 3 for their keywords when they were previously on pages 15-20. No new link building to the other domains, I hadn't given them any focus due to other projects. The issue is the domain name which was banned was a real money maker with an aesthetically pleasing theme. Now its completely deindexed, and I dont know why. Despite the fact I am lost an income stream, I really would like to know why this occurred at all. I feel like I walked into my job, was fired and not told why. This isn't the first time this has happened to me, however previously it was my own fault because I used an affiliate template and it didn't occur to me 5k other people were doing the same thing. (earlier days before I learned more about link building and basic SEO). So, my question is what exactly happened yesterday? Did anyone else see an sudden change in traffic or rankings? Has anyone else experienced a complete deindex of their domain name, and if you have is this permanent or is google known for accidental / temporary removals during an update to their algo? I may share my link if it will help, however I prefer not to unless its in private. Also if someone has access to Matt Cutts directly so I can ask what I am doing wrong, or has any idea how to contact someone at google (other than a request for reinclusion) I am all ears. Its very frustrating to see a decision made to ban my domain name without so much as an email saying "we dont like you". All responses and opinions are welcome and appreciated!
Affiliate Marketing | | getbigyadig0 -
Duplicate versions of pages on my site are getting indexed by Google...I think...
Hello, Our site has a very high bounce rate, which in part is down to a slightly old fashioned design, and also because we are a retailer and I imagine many visitors are simply quickly comparing prices and then leaving. However, having had a look in Google Analytics, I think that there is another issue that is contributing to a very high bounce rate. When I look in Content > Top Content, and order the pages in order of Bounce Rate, high to low, there are hundreds of instances of pages with just one or two visits in the last month, and a 100% bounce rate. The links are the same as our home page or pages on our website, but with extra letters and numbers at the end of the url. We have an affiliate scheme, which provides our affiliates with unique codes for the products they want to link to, and my guess is that these urls are getting indexed. I've looked at a few other links, and they go to translated versions of a page from our website, generated by Google. Other urls seem to have been generated by search results from our own search on the website. What worries me is that there are lots and lots of versions of the same page, with slightly different urls. I am by no means an SEO expert - I work for a very small company and am basically learning as I go - but I know that duplicate content is bad news. If the pages were on our own site, we could use 301s to redirect, but what about translated versions, or urls generated by affiliate schemes, or search results? Many thanks, Sophy
Affiliate Marketing | | sophycolbert0 -
My new site experienced a sudden drop in Google rankings
We launched a new affiliate site at the beginning of April this year dealing in reviews, vouchers and price comparison for a niche product. We had a pretty good start, with some of our target keywords ranking #8 #10 #7 but this week they have suddenly dropped off dramatically - like 36 or 42 places. We haven't made any changes to the site apart from publishing new content pieces, such as news posts and reviews - does anyone know why this would suddenly happen? Thanks
Affiliate Marketing | | JohnHillman0