This article has an update! -> please refer to Installing Google Universal Analytics for NetSuite
For those who don't know, Netsuite is a hosted, ASP model ERP solution - you can manage your entire site and back-end inventory and accounting with one package, all through your browser. I spend a lot of time with their system, and will be posting on occasion tutorials, reivews, complaints and praise.
Google Analytics is actually Urchin web stats, which Google bought and retooled. They started offering it free in late 2005, and it's comparable in power and usability to some very expensive packages. I highly recommend it.
- First, you must have a Google Analytics account with an available profile - you can find out more here.
- Create a custom tag named GOOGLYTICS (or whatever name you prefer). Add to the Footer section under site templates. It really only needs to be someplace on each page, inside the and tags. Your code will look something like this:
- For the Checkout and My Account tabs, replace the GOOGLYTICS tag with the following (this is necessary so users don't get warnings about insecure content on secure pages. You can also just use the secure version for everything.):
- Set up order tracking code : There are a number of ways to set this up, and it's working imperfectly for me at the moment. The goal tracking works, but the revenue fails and I can't track conversions by keyword or landing page, I think because I can't add the JavaScript tracking code to the 'begin checkout' button where the domain changes from mine to Netsuite's. Here is the code I made: UTM:T|<%=getCurrentAttribute('confirmation','ordernumber')%>| <%=getCurrentAttribute('confirmation','partner')%>| <%=getCurrentAttribute('confirmation','total')%>| <%=getCurrentAttribute('confirmation','tax')%>|< %=getCurrentAttribute('confirmation','shipping')%>|Portland|OR|USA UTM:I|<%=getCurrentAttribute('confirmation','ordernumber')%> |nosku|placeholderitem|nocat|0.01|1
Note that I was having the form show up in spite of the hidden style, so I added it all to a div named 'google_tracking' that I set to display:none; in an external CSS file. I also hand entered some values that Netsuite doesn't provide dynamically. I tried leaving out the UTM:I line altogether since there's no way to make it meaningful, but Google didn't seem to like that.
Add this code to the 'Order Confirmation Message' box under the checkout tab.
- Set up the goal tracking in GA
- Under analytics settings, click the edit button under settings. Click edit next to G1, the first goal.
The goal page will be:
https://checkout.netsuite.com/s.nl?c=######&sc=4&category=thanks
This time replace the #'s with your Netsuite account number. - Name the goal page whatever you like and set it active.
- Funnel navigation (optional): This might not work right for you, but here's what I did:
- Step 1, shopping cart (check the box for required):
https://yourdomainhere.com/s.nl?sc=3 - Step 2, new user/sign in:
https://checkout.netsuite.com/s.nl?c=######&sc=4 - Step 3, enter address:
https://checkout.netsuite.com/s.nl/c.######/sc.4/category.billing/.f - Step 4, shipping:
https://checkout.netsuite.com/s.nl?c=######&sc=4&category=shipping - Step 5, payment:
https://checkout.netsuite.com/s.nl - Step 6, review and submit:
https://checkout.netsuite.com/s.nl?c=######&sc=4
- There are a number of problems with setting up the funnel, one being that Netsuite often gives different URLs for the same pages in the checkout process. I know the reporting isn't right for our checkout, but I'm still tinkering and may find a way to get it right.
- Set up multiple domains. One of the frustrations that all Netsuite customers have to deal with is losing your domain name in the URL when a customer goes to any secure pages - whether to check out or to access their account settings. Google analytics can be set up to track sessions across multiple domains for just these types of situations, but it requires two things (click for instructions in Google's words).
- Add two lines of code to the tracking on every page:
_udn="none";
_ulink=1;
- Add javascript to links pointing to Netsuite.com domains
checkout to Purchase NowPurchase Now
This can't be done as far as I can tell, given the way netsuite works. You would need to change links that would normally look like:
First, I don't like having links that spiders aren't guaranteed to be able to follow. I would instead recommend using an onclick event for links, like:
But the big problem is that most people transition from the store domain to Netsuite when they click the 'begin checkout' button (which is really a form submission) in the cart page. Unfortuantely there is no way to add the javascript to that button, so there will always be some disconnect in Google Analytics until something changes. I wouldn't expect the funnel navigation tracking to work right until that problem can be fixed.
The real problem is that no one wants their customers to have to change domains while on an E-Commerce web site. Unfortunately it's pretty tough for Netsuite to allow their customers to install their own SSL certs and mirror them across the big array of clustered servers that make up their web front end. I can only hope that the unending clamoring for this feature from their customers will spur them to find a workable solution (then we can move on to other stolen branding problems Netsuite has, like the favicon.ico and the occasional Netsuite-branded 404 page).