:: Celigo :: 
Customer Login
 
SolutionsCustomersBlogAbout
On-Demand Simplified Solutions and services tailor made for on-demand

Google Analytics for NetSuite

| | Comments (14) | TrackBacks (0)

Unless you've been living in a cave for the last two years, you have by now heard about Google Analytics--the so called next best thing since sliced bread. Not only is it one of the best web analytics tools on the market, but it's also free.

If you're running your web store on NetSuite, you may have heard about the challenges in implementing Google Analytics. In this posting, we will attempt to walk you through the details of setting up Google Analytics.

Once completed, you should be able to track web site activity across product catalog pages, shopping cart and checkout pages, and order submission and confirmation pages. Additionally, you can see a listing of all orders placed through your site including the ability to see the order number, order total, shipping total, and tax total.

We used the steps defined in this article as a basis to get started on this project.

 

Google Analytics Setup

1) Registration/Login

If you don't have an account already, first sign up for a free Google Analytics account here. Login to the account.

2) Create Website Profile

Under Web Site Profiles, click on Add Web Site Profile. Enter the name of the domain and click Finish. A block of code will be displayed as the example shown below. Please note the account number that is displayed in the form of UA-XXXXXX-X as shown below. You will need to plug in this number in the GANALYTICS tag defined in Step 1 of the NetSuite Setup section.

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._initData();
pageTracker._trackPageview();
</script>

3) Setup & Create Goals

Under Analytics Settings > Website Profiles, click the edit button in the Settings column next to the just created domain. First ensure that the E-Commerce Website checkbox in the Main Website Profile Information section is checked. If not, click Edit for the section and make this change.

You can create multiple goals. We created the following goal to track the checkout process:

Click edit next to G1. Enter the following for Goal URL where ###### is your NetSuite account number.

   https://checkout.netsuite.com/s.nl?c=######&sc=4&category=thanks

For example: https://checkout.netsuite.com/s.nl?c=TSTDRV231585&sc=4&category=thanks (NetSuite Account =TSTDRV231585)

Name the goal page with whatever name you like (we called it Checkout) and set it to be active.

Next, setup the goal funnel. This is an optional step that allows you to specify a series of pages leading up to the Goal URL. In this example, we define the checkout steps that lead up to an order submission funnel. The exact pages that the funnel is comprised of is completely up to you. Here's an example of what we did (please note that these URLs may change slightly on your account):

   Step 1 - Shopping Cart:
   http://www.yourdomainhere.com/s.nl?sc=3 
   Step 2 - New User/Login:
   https://checkout.netsuite.com/s.nl?c=######&sc=4 
   Step 3 - 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 
   Step 7 - Order Submission:
   https://checkout.netsuite.com/s.nl?c==######&sc=4 
   Step 8 - Thank You:
   https://checkout.netsuite.com/s.nl?c==######&sc=4&category=thanks

 

 

NetSuite Setup

1) Create Tag

Create a custom tag in NetSuite to represent the Google code by going to Setup > Web Site > Web Site Tags. We called ours GANALYTICS. The default value will be blank--such as <!-- Google Tracking Code -->.

Use the tag substitution feature in NetSuite to use the following code for every tab that needs to be tracked. You will need to replace the value of XXX with the value provided by Google for your website profile as described in the Google Analytics setup above.

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._initData();
pageTracker._trackPageview();
</script>

 

2) Place the GANALYTICS Tag


Add the created <GANALYTICS> tag in the <Head> section of your HTML


3) Call Google JavaScript Method

Create a new tag named <GACHECKOUT> that has a default value of <!-- Ecommerce Tracking Code -->. In the Checkout tab, replace it with the following code (note that this tag needs to be placed before the </body> HTML tag):

<script>

pageTracker._addTrans(

    "<%=getCurrentAttribute('confirmation','ordernumber')%>",                         

    "<%=getCurrentAttribute('confirmation','partner')%>",                             

    "<%=getCurrentAttribute('confirmation','total')%>",                                      

    "<%=getCurrentAttribute('confirmation','tax')%>",                                 

    "<%=getCurrentAttribute('confirmation','shipping')%>",                                 

    "Portland",                                                                           

    "OR",                                                                                  

    "USA"                                                                                  

  );

 

pageTracker._addItem(

    "<%=getCurrentAttribute('confirmation','ordernumber')%>",                         

    "nosku",                                                                                

    "<%=getCurrentAttribute('confirmation','ordernumber')%>",                                     

    "Office",                                                                                         

    "<%=getCurrentAttribute('confirmation','total')%>",                                      

    "1"    

);

  pageTracker._trackTrans();

</script>


Note:  If there is no checkout tab on your account, you can also place the above script in the order Tracking script HTML at Setup > Websites > Setup Websites > Shopping Tab > Order Tracking Script HTML.

 

Google Analytic Reports Setup

Google Analytics provides many different forms of reports that you can use. A detailed review of the different types of reports are beyond the scope of this post. We would, however, like to point you to some of the reports that we setup to monitor the above goals.

1) Transactions 

This report allows you to view a listing of all orders placed through your site including the order number, order total, shipping total, and tax total.

2) Content Performance

This report allows you to view the performance of your pages--metrics such as page views, unique page views, time spent on each page, etc--using the actual page titles. 

 

3) Visits to Purchase

 

4) Top Landing Pages

 

Conclusion

The goal of this post was to provide you with details on how we have setup Google Analytics for a NetSuite web store. As mentioned before, the setup for each NetSuite account may differ given that each account is unique.

Since Celigo is a NetSuite Solution Provider, this work represents a typical project in our portfolio of services. We decided to share our knowledge on this topic so that others can benefit from our experiences given that this is a hot topic within the NetSuite community.

If you have any comments/feedback or have improvements to the above directions, we would love to hear from you so that the entire community can benefit as well. 

-- Jan 

 

 

0 TrackBacks

Listed below are links to blogs that reference this entry: Google Analytics for NetSuite.

TrackBack URL for this entry: http://www.celigo.com/~celigoco/blog-admin/mt-tb.cgi/3

14 Comments

celigo Author Profile Page said:

Please note that section 2 & 4 on the analytics setup section have been changed slightly.

Jan

Anonymous said:

Where in the code are you placing the tag?

I'm getting the following errors rendered in the checkout source code:

UTM:T|[Error processing dynamic tag getCurrentAttribute('confirmation','ordernumber') : unknown record type null]|
[Error processing dynamic tag getCurrentAttribute('confirmation','partner') : unknown record type null]|
[Error processing dynamic tag getCurrentAttribute('confirmation','total') : unknown record type null]|
[Error processing dynamic tag getCurrentAttribute('confirmation','tax') : unknown record type null]|
[Error processing dynamic tag getCurrentAttribute('confirmation','shipping') : unknown record type null]|

Have you gotten Google Analytics to track both conversions and revenue for NetSuite sites?

celigo Author Profile Page said:

The GANALYTICS tag is tied to each tab that you want to track. Send us an email if you have other questions regarding this.

It currently does track revenue but it does not tie conversions with revenue. We're working on this part at the moment - stay tuned.

Jan

David said:

Hi,

I have manged to get Google Analytics working to track conversions as per the post above! Thank you.

However the problem I get is that the referring source for the transaction is set to my web store Http://dna-worldwide.com rather than the search engine, PPC advert or organic listing that it came from.

Does anyone have any suggestions on how to get that to work? As my site is WSDK I can code extra info into the buy buttons, add to cart etc.. if needed.

Do you have any suggestions?

Best

David

celigo Author Profile Page said:

David, this is a known problem. We're working on enhancing the above to support this functionality, and hope to make it available soon.

Jan

Kevin said:

Great info and thanks for your post. However (there's always an however isn't there :-) we don't have Netsuites "Advanced Site Customization" for our site, we're pushing the envelope on the basic level...is there anyway to get this kind of e-commerce tracking in Netsuite/Google without it? (I'm specfically looking to integrate the purchase funnel into our site but I don't have access to tags in the web site set up area). Right now I have the analytics code build into HTML pages that are placed into the description and greeting area's of each page.

Kevin

celigo Author Profile Page said:

Kevin,

Unfortunately, you really need Adv Site Customization to make this work.

Jan

James said:

Hi Guys, good post! We are looking to integrate GA with NS.
I cannot see the images you posted on this article, possibly these were re-located. Could you please display the images so I can understand this better?
Thanks a lot!

John Svid said:

Wow great site! Some really helpful information there.
I’m sorry for little off-topic, but I want to ask you about design of this site.
Did you make this template yourself or got from any templates website?
Looks pretty cool for me. Wonderful well this reading.

Mark Pris said:

Hello, your website is very informative and useful,
I would like to share with you links, send all the questions
on my e-mail.

Jan said:

Has anyone had success tracking both revenue and conversions from NetSuite with Google Analytics?

Also, does the code work any differently with the new GA.js script that Google is using now?

We are moving to the new script and would like to get conversion tracking working as well. Thank you in advance for any help.

Regards,

Jan F

Anonymous said:

Great write-up. Can the concepts here be adapted to work with the recently released "new" google analytics tracking script "google-analytics.com/ga.js"?

Has anyone tried it?

Thanks.

Treadmill said:

We use netsuite and have the netsuite analytics package. The reporting is highly unreliable.

Is there any updates on how to integrate google analytics with netsuite. I do the SEM work and SEO. It would be a huge benefit to get all my reporting in one place and I really like the google analytics program.

Tom said:

"Add the created tag in the section of your HTML"

I have read another set of instructions that said to put the tag in the footer or body of your HTML.

You say to use the tag substitution (with the tracking code) "for every tab that needs to be tracked". Is that typically only used on the home page and the products and product category pages? Is there any reason to have the tracking code substituted into the check-out tab?

Thanks, Tom
PS: Great info.
PPSS: Google Analytics will now track the use of the product search feature in our NS web-stores.

Leave a comment