|
43bc2bd2f4f5eea925e61a3eb61362b4
|
Google Analytics beta testingby tobi - jaded Pixel - 09:41PM, Nov 10, 2006 |
|
OK Integrating google analytics properly into shopify is proving harder then I thought. The biggest problem is the somewhat cryptic admin interface of GA and the fact that it often takes 24 hours for anything to show up. I thought i’d go ahead and post what i have got so far. Some of you here are real GA experts and I hope that we can puzzle out together how to get GA to work really well. Once we figured it out i’ll add some nice guides or even direct GA support to the Shopify admin but in the meantime we do it manually, as of today all the required tools should be in place.
Important: You have to replace the _uacct parameter with the GA identifier which you noted down earlier. This should be all you need for real e-commerce product tracking. Lets hope this works. Any feedback is highly appreciated! ---
Tobias Lütke Last edited 05:44PM, Jan 03, 2007 |
|
|
Tobi, I have implemented this and will update on its status tomorrow. I still don’t understand how to set up the goal tracking for the checkout page on Analytics, though. I currently only have one goal set—tracking which people add to cart. This lets me see which Adwords and inbound links are worth me spending time and money on—inbound links from YouTube so far have been giving me a full 100% add to cart ratio, for instance—so I’ll be ramping up advertising over there. But I want to add a second “goal” which will track what people complete a purchase. Analytics asks for the URL of the page that users hit when they do the goal (the thank you page, in this case)—what should I put in there? I suspect it would have something to do with the “head” match options at the bottom of the “Add new goal” page on Analytics, but I’m not sure.
|
|
|
get this when trying to save above code to checkout area of admin undefined method `create!’ for nil:NilClass
|
|
|
Er sorry. Try again. ---
Tobias Lütke
|
|
|
Ok, got the code in and well sit back and see how it does. Thanks for getting this started.
|
|
|
I’ve got it all set up too. I’ll let you know how it goes. Exciting.
|
|
|
hi Tobi – thanks for this.
|
|
|
We ran a test order yesterday evening, and so far nothing has showed up as of yet. I think this is what you mean by, ”...it often takes 24 hours for anything to show up.” We’ll let you know what we find.
|
|
|
Nothing showed up here either. It seems that paypal is not satisfied with this solution. We will have to think up something differently. ---
Tobias Lütke
|
|
|
I know that data was coming back. After the test order, we were redirected to the thank you page and I checked the html code. There was data of our order showing up for the GA script to handle.
|
|
|
yea but it seems that GA doesn’t manage to associate this back with the right account. GA just needs a real API so badly its not even funny. ---
Tobias Lütke
|
|
|
I think I may have found the problem. From the GA docs:
Unless you set the body onload from the backend, I didn’t see this in your example script I copy and pasted. Should we envoke the utmSetTrans function with the javascript method? UPDATE: Nevermind. I see your invoking utmSetTrans with javascript. — Last edited 11:12PM, Nov 11, 2006 |
|
|
I believe the standard tracking script is missing though. since the thank page doesn’t use the stores theme. https://www.google.com/support/analytics/bin/answer.py?answer=27203
UPDATE: WOW. I see you have this in there too. OK, I am done for the evening…..... — Last edited 11:35PM, Nov 11, 2006 |
|
|
The issue is the domain change. GA uses cookies to track users and cookies don’t survive the domain change to checkout.shopify.com. There are ways to fix this but it means that we will have to integrate GA differently. This is really a pity. I was hoping that this would work and we would be done with the topic =) ---
Tobias Lütke
|
|
|
OK to get the data to survive the domain change you have to add Then in theme.liquid add this before I think this should work. Or have you already tried this? By the way here’s the support article: https://www.google.com/support/analytics/bin/answer.py?answer=26915
|
|
|
I’m thinking i can simplify this. Maybe i can come up with a simple javascript which people could include which just puts the onsubmit handler on all the links which require it. The stupid thing is that google could do that themselves. All this parameter hackery is really just a lack of javascript skills on their part… ---
Tobias Lütke
|
|
|
I added GA to my site and this as well. Looks like it could be cool. I’ll report any details/findings off my store :) ~allen ---
~Allen
|
|
|
Does the technique David_B posted work?
|
|
|
Not sure but I just updated my scripts so We’ll see. — Last edited 06:28PM, Nov 14, 2006 |
|
|
Well. Its still not tracking sales. I did notice that it was starting to track our admin interface traffic though. I have since removed David_B’s example. Tobi, have you come with anything yet?
|
|
|
I’ll revisit this soon. The Paypal IPN issue is keeping me busy right now ---
Tobias Lütke
|
|
|
Hi everyone, I just came across this in the GA help area, maybe it’s the secure pages that’s preventing the proper tracking? How can I obtain tracking code for secure pages? Looks to me like the only thing that’s different is the urchin javascript source URL: https://ssl.google-analytics.com/urchin.js instead of http://www.google-analytics.com/urchin.js What do you think? I am totally swamped this week so I didn’t yet try this code… it’s just an idea. ---
Folkology – Authentic folk craft and culture from Hungary
|
|
|
I’m almost certain the SSL change is required. I believe browsers will refuse to load component files (including external javascripts) from non-https URLs when loading a page from an https URL. Once you start the checkout process, everything from there on is https. I also believe the __utmLinkPost change pointed out by David B will be required. When using Paypal, we are moving through 3 completely separate top-level domains to complete a purchase: 1. http://yourstore.myshopify.com If I’m reading the support article from David B’s post correctly, this means the __utmLinkPost method will be required. This also means that both theme.liquid & the preferences->checkout & payments->content & scripts area code will require the use of these values:
What I’m not clear on is whether making these changes in theme.liquid, cart.liquid, and the checkout & payments script area is enough. Does the Shopify checkout code (which we can’t touch) also require the use of __utmLinkPost to make the tracking & conversion data carry all the way through?
|
|
|
The main place where the _utmLinkPost will be required is the screen which proceeds the checkout, the one where you can choose the gateway. This screen only appears if there is more then one option (or if the one option is google checkout). Unfortunatly this means shopify will have to change for the worse. Since javascript has to be executed before the domain change to checkout.shopify.com we will have to abandon the internal redirect logic which is running right now and always show the payment checkout screen, even when there is only one option. I’m a bit reluctant to make this change because it negatively impacts people who don’t use google analytics and who have only one gateway. I also see great value in supporting GA though so its not out of the question. I wish GA would post their API so that we can integrate easy with them without requiring any cryptic javascript or the like. ---
Tobias Lütke
|
|
|
Tobi – I’m not sure I completely follow the logic as to why the __utmLinkPost JS has to be added the way you describe, but I’m sure you know what you’re talking about. You could send down to the browser a small page that simply runs a JS to to the __utmLinkPost magic & then redirect to the (single) enabled checkout option. The user may notice a screen flicker/refresh, but would not have to choose the only checkout option available. Also, I just started messing with all of this in the last 2 or 3 hours, and I already have data showing up in my newly-created GA profile. I don’t yet see any hits recorded within the checkout.shopify.com site, but that may just be a time lag issue.
|
|
|
The GA cookies are now surviving the redirect to checkout.shopify.com, thanks to the use of __utmLinkPost, but there’s no urchinTracker() call in the checkout pages to let GA know the user is now in the checkout process. I think with the current solution we may be able to track final conversions with the “thank-you” page code, but will not be able to track the individual steps in the conversion funnel: 1. view cart – should be able to track, since it is on myshopify.com
|
|
|
Well thank you page is the one that counts because it indicates the sale. So if thats all working then we are almost there. ---
Tobias Lütke
|
|
|
What is the URL of the thank-you page? I don’t have a second Paypal account set up, so can’t easily test a full purchase. Paypal kicks me out as soon as it sees I’m trying to pay myself. (Is there an easier way around this, besides setting up a second PayPal account?) If the thank-you page code works, we will be able to track the ultimate conversion, but not the steps in the sales funnel that are on checkout.shopify.com. This is certainly better than no conversion tracking, but it would be very informative to know which how many abandonments are happening at each page in the checkout process. This could provide valuable information for improving conversion rates. For example, if we find that a lot of buyers are dropping out on the shipping method page, we might want to look at our shipping methods/rates.
|
|
|
Ok – found & configured the Bogus gateway, so now I see what the thank-you page looks like. Unfortunately, it doesn’t have a URL that is well-suited to matching in GA’s conversion funnel tracking. As I said in the post before this one, it looks like we can track the ultimate conversion (and the monetary value of that conversion, which is important), but we can’t track any of the funnel steps leading up to that conversion. This is less than ideal, sense we may be missing important information on where the abandonments are happening. What we need to do this is the ability to add GA tracking code snippets to all of the pages in the checkout.shopify.com flow. Tobi – any chance of adding a place in the admin pages to put this tracking code, and include that code snippet on all the checkout pages? This seems to be a more general solution that having a place to put the GA _uacct number, but you might prefer the control offered by only allowing the administrator to enter the _uacct, and then you can conditionally include the appropriate (well-known, tested, safe) tracking code if that value is entered.
|
|
|
Did anyone actually see any transaction reporting from the thank you page in their GA account reports? If the transaction reporting is working, I will be fine with that, and then later on we can figure out a way to track the conversion funnel. For now I think the critical part would be to make the thank you page tracking work. I ran a test purchase earlier this week with all the code in place, plus using the SSL version, plus putting onSubmit=”javascript:__utmLinkPost(this)” on the cart checkout button. The transaction didn’t show up in my GA report. :( My situation is a little more complicated though, because i am using a http://shop.mydomain.com URL for my shopify store and my GA account is set up to track both my domain at http://www.mydomain.com and all subdomains, so I already have _udn=”mydomain.com”; in my tracking code. I am afraid I can’t add another _udn=”none”; parameter because it will confuse GA. Can somebody who understands how these udn things work confirm this? (I am sure I am not hte only one using a subdomain so this might be an important question.) ---
Folkology – Authentic folk craft and culture from Hungary
|
|
|
I don’t think anyone got the e-commerce tracking working yet. Do you know the code which should appear on each step of the checkout? I’m considering to do what you said and let people just paste their _uacct number and then inject the right html on each page automatically ( in the shop and checkout both ) ---
Tobias Lütke
|
|
|
I have just seen the first e-commerce tracking transaction show up in my GA reports. It does work. Here’s what I have: On the checkout & payment preferences page, in the additional content & scripts section: in in
|
|
|
Tobi – I think all you have to do to get goal funnel tracking working all the way through checkout.shopify.com is to include this code on each page, with the shop owner’s _uacct value:
Since we already used One remaining issue would be defining the goal funnel URLs in GA. Using the bogus gateway, I see: Using PayPal, I see: If you only support one payment method/gateway, you wouldn’t see the choose payment method page. I’m not sure if the GA funnel tracking’s URL matching is going to be able to match against these URLs. You might be able to differentiate the last two steps using regular expression matching, but it would be much easier if a simple head match could be used, perhaps something like this: view cart: http://myshop.myshopify.com/cart Of course, additional identifying details (cart id, etc.) included in the URL past these stem values would be no problem.
|
|
|
Hey David. Thank you for all the investigation and time you put in and posting your findings. I installed your code this morning and its working great! We are able to get statistics on our orders now. Just need to tie that in with the rest of analytics so we can track goals. Thanks again.
|
|
|
Can funnel URLs take wildcards perchance? ---
Tobias Lütke
|
|
|
For each funnel URL, you can choose to use a regular expression match, a head match, or an exact match. Given the current checkout URLs, I think we could use an RE match to pick out the ”/pay” on the end of the shipping method selection URL & differentiate it from the thank-you URL. It looks like we’d be okay with a head match on the others.
|
|
|
I tried it and it’s kinda working. Only one thing, I had 3 orders yesterday but it only shows “one” on the GA. Does anybody have any idea why? ---
http://www.shopmodi.com
|
|
|
I’m sorry, but I’m not a coder. Is there any updates on exactly what code we should use to get this working? We use Google Analytics already but not for conversions. We use Authorize.net for a gateway. It would be great if one of you brilliant people could tell me how to make this stuff work on our site.
|
|
|
So any confirmation yet that this is working properly yet? Can I just implement what David wrote?
|
|
|
Why not try it & let us know? My store’s not yet open for business, so all I’m seeing is my handful of test transactions, using the Bogus gateway. It appears to be working as far as I can tell with my current setup.
|
|
|
David, I tried and it seems to be working. But not 100% though. It doesn’t track every orders I’ve had which is weird. Like I mentioned earlier, I’ve had 5 orders since I put the code in but it shows only 2 on the GA. ---
http://www.shopmodi.com
|
|
|
lee – thank for the feedback. Is there anything in common between the orders you do see in GA, versus the ones you don’t see, or is it completely random? Not sure what it could be at this point. — Last edited 02:46PM, Dec 02, 2006 |
|
|
David, I think it’s completely random. So odd!! How is yours? Does this happen to you? or anybody that use this code? ---
http://www.shopmodi.com
|
|
|
all mine have so far been accounted for by google. No problems here.
|
|
|
I just want to say thank you to all of you people out there who are working so hard to resolve this. I keep checking back, completely confident that you will all eventually work out all of the bugs and kinks. We all benefit from your diligence. Thank You. ---
Leo in Victoria
|
|
|
I implemented this last week, and thought it wasn’t working. Turns out that transactions are being recorded for the purpose of calculation in the Cost-Per-Conversion stats, but on the analytics page, I see no transactions being recorded under the e-commerce summary.
|
|
|
i did as David suggested and GA recorded the 1 sale that happened (that i had tried out myself:)). GA also recorded the 77 unique visitors that the site attracted today. Love it! GA has a wealth of information and i can’t wait to start mining it!
|
|
|
I have finally got some sale records showing on GA. Thank you! Here are two links that show how to get some more information out of GA with Adwords: How to Assess Search & Content Network Advertising using Google Analytics How to Get Detailed PPC Keyword Data from Google Analytics Has anyone got Goal Tracking to work? I have this configuration for sales tracking but nothing is coming in: Goal URL: This is my G2. My G1 is “buying intention”, where Goal Url is defined as: http://www.myshop.com/cart . About 5% of my visitors is adding things to the cart and it would be very useful to know where are they abandoning the cart. ---
Ana Rita
|
|
|
Tobi, with all the information that has emerged, I am not sure that your original instructions are still valid. Are there any changes or should I go ahead and do what it says in the original post? – Thanks. ---
Leo in Victoria — Last edited 05:39PM, Dec 17, 2006 |
|
|
True. Maybe someone should post a guide on the wiki like the one for google base export. I’d replace this post with this then. ---
Tobias Lütke
|
|
|
Leo, In the mean time, David’s post is the one that got my tracking working. The one that starts with, “I have just seen the first e-commerce tracking transaction show up in my GA reports. It does work. Here’s what I have: On the checkout & payment preferences page, in the additional content & scripts section:” — Last edited 09:28PM, Dec 17, 2006 |
|
|
Thank you Tobi and Dan ---
Leo in Victoria
|
|
|
David’s code didn’t work for me, and i am troubleshooting it with GA customer support. They just told me what might be causing the problem, but I will wait to see if mine works now before I post the correction here. (It’s weird that it works for David, but doesn’t for me…) I’ll let you all know later today when my GA account is refreshed and shows (or doesn’t) the new test sale. ---
Folkology – Authentic folk craft and culture from Hungary
|
|
|
Here is what I have. Replace the XXXX with your code from analytics. In the Profile Information of your domain, make sure you have e-commerce website selected theme.liquid code
cart.liquid code
checkout preferences code
We are also using Paypal Payments Pro. Not sure if this makes a difference in reference to the way the checkout flows but this code has been working for us. — Last edited 10:08AM, Dec 18, 2006 |
|
|
No other orders were accounted by GA since my last comment. Two in total. With different payment methods. Is anyone else having such an irregular behaviour? ---
Ana Rita
|
|
|
My GA tracked all order made by me for the test purposes and just a few more out of 20 orders I’ve had. I have no idea what could’ve been wrong. ---
http://www.shopmodi.com
|
|
|
Sorry if this is a dumb question: where in the cart.liquid do you put the code? And my cart.liquid already has a div id for cart. Do I need to change that? (The validator says I can’t use the same id twice). I put these codes in earlier but nothing showed up in Analytics. Correction: it says my revenue is $0.01! Thanks DanW, David, you are the bee’s knee’s.
|
|
|
Hi Claudia, The only thing that needs to be added to cart.liquid is this.
Add this to the end of the form tag. — Last edited 06:18AM, Dec 19, 2006 |
|
|
My head is about to explode from all this tracking mess. I have exchanged about 10 emails with GA support, and it still doesn’t track sales. So far all the things they have told me to change are things that work for all of you other shopify guys who use the code from this thread. First they told me that the tracking code on the thank you page is not implemented correctly because the code is split in half. So I changed it to this (put the general tracking code at the beginning as one code block):
Still not tracking sales. (Sidenote: They said that splitting the code in half “is not supported implementation. It is possible that this implementation is causing discrepancy in recording the transactions. Please ensure that the tracking code is installed as a single block. The __utmSetTrans() function can be called later using another set of <script> tags.”) So then I emailed them again, and now they say: I reviewed Since I don’t think any of you who are successfully tracking sales have this utmLinker stuff implemented, I don’t want to do it either. (Besides, the utlmlinpost thing in the cart form should serve the same purpose as utmLinker, right?) Yesterday for a brief moment I thought that maybe the cart form could be the culprit. The submit button is an image, and maybe it is not triggering the onSubmit Javascript event? Or maybe it doesn’t trigger it in all browsers? But then I looked at DanW’s site, and his checkout button also is an image and his sales track. So this is not likely to be the main culprit. (Although if there is such a bug in some browsers – which I do not know, it’s just a hypothetical scenario that popped up in my head while trying to find what might cause tracking problems – that would explain why some of the sales do not track for you guys.) So now I ran out of ideas on what to do. Anyone have any ideas on what could be causing the problem? (And any of the Javascript wizards here have any comments on the onsubmit not being triggered thought?) ---
Folkology – Authentic folk craft and culture from Hungary
|
|
|
PS. DanW, I noticed you have ---
Folkology – Authentic folk craft and culture from Hungary
|
|
|
Maybe its something to do with paypal (standard) integration. I made a test order with paypal before we opened the shop and I don’t remember being brought back to the thank you page. The jaded pixel team wrote somewhere in this forum that there is nothing to configurate in paypal for it to work. True, its working. But maybe auto-return is glitchy. ---
Ana Rita
|
|
|
One hint about goal tracking in GA: I just noticed I have ”/orders” on “Content Drilldown” reports. ---
Ana Rita
|
|
|
I am still stuck in the same place with the GA tracking (that is, it’s still not working)... :( I don’t think it’s paypal that’s causing the problem, because my test orders using the bank transfer method (manual payment) do not track either. ---
Folkology – Authentic folk craft and culture from Hungary
|
|
|
I have ecommerce tracking working perfectly using the post by danW Dec 18 (10:06AM) I am using Website payments Pro US But have also got it to work on another shopify site that I am testing at the moment using the Bogus Gateway. I now want to setup the Goal tracking. Have there been any further developments with regards to Davids post At the moment I put in the following as my funnel: 1. MY STORES HOMEPAGE 2. SHOPPING CART PAGE 3. ADDRESS INPUT PAGE 4. PAYMENT PAGE 5. THANKYOU PAGE AND MY GOAL PAGE IN GOOGLE https://checkout.shopify.com/orders/1####/######b7e5a861a016a866f41a###### Im pretty sure that 1 & 2 URLs will work fine However im also pretty sure that URls 3,4,5 will not work as the numbers change depending on the product chosen. Does anyone have any advice with regards to the possible static urls that I could use. Thanks — Last edited 12:58PM, May 04, 2007 |
|
|
Thanks for all the great work everyone did to get Google Analytics working with our Shopify stores. I have successfully implemented the tracking on my first shopify store and all the data is coming in. Question: — Last edited 04:37PM, Jun 21, 2007 |
|
|
Mhhh ‘m trying to setup a funnel on intention of buy using mysite.com/cart/ as goal but it seems not to work… any advice?
|
|
|
Google tracking of PayPal integration – is the above still valid since google updated its tracking code? I have searched the wiki and found no article on goal tracking. Has anyone done this in the last 6 months. Let me know whether you used DanW’s code. Jonathan ---
www.marketquarter.com The Market Quarter
|
hypersigil
Member
10:10PM, Nov 10, 2006