Home » News & Blog  

Posts Tagged ‘integration’

How to Integrate NetSuite with Google Analytics

Thursday, October 8th, 2009

We recently announced that we found a workaround to integrate Google Analytics with NetSuite and it’s available as one of our services. We decided to share this information with everyone and tell you how it’s done.

If you have no scripting skills we can do this for you, just contact us.

Although this is a pretty small script, it achieves something pretty important, so we decided to release it under the LGPL license which means you can use it or adapt it to your needs, improve it and distribute it freely across the web as long as you don’t remove the copyright notice.

Basically Google Analytics is not able to track all the data (keyword, referrer and everything else) because it changes the domain name. Although it’s a pretty simple approach, it does a lot.

Our aproach to this is pretty unique in two ways:

  1. It uses a hidden iframe and pageTracker._getLinkerURL() while Google recommends using a regular link and a pageTracker._link() to make the eCommerce tracking work. This is pretty important because it makes the code so much smaller than having to parse all the links and forms on the site.
  2. Instead of linking to the checkout page like Google suggests in their documentation, in the case of NetSuite, the checkout page does an unnecessary refresh we decided it’s better to just have a blank html page that you can send the cookies to.

In our example we are on the domain www.roomitup.com and we have some cookies stored by Google Analytics, but visible only within that domain.

We need to find a way to transfer all those cookies into checkout.netsuite.com

In your page, after the Google Analytics code, write the following lines:

//***********************************************************************************
// Copyright 2009 Citricle. All rights reserved.
// This script is released under the LGPL license which means you can use it or adapt it
// to your needs, improve it and distribute it freely across the web as long as you don’t remove
// this copyright notice. For technical support go to www.citricle.com.
//***********************************************************************************

var domain = “roomitup.com”; //replace this with your own domain name
try    {
if(document.URL.indexOf(domain) != -1) {
if((document.referrer.indexOf(domain) == -1)  && (document.referrer != “”))    {
var iframeElement = document.createElement(”iframe”);
var proxyAddress = “https://checkout.netsuite.com/c.664770/citricle-ga.html”; //replace 664770 with your own NetSuite Account ID
iframeElement.setAttribute(”src”, pageTracker._getLinkerUrl(proxyAddress));
document.getElementById(”div__header”).appendChild(iframeElement);
iframeElement.style.display = “none”;
}
}
}
catch(e) {};

This will create a hidden iframe inside your website’s header (id is div__header) that will load the ga-tracker.html page, and it will pass the cookies using a query string generated by pageTracker._getLinkerURL(). That query string will contain those cookies that Google Analytics needs to track the keyword, referrer and everything else. Simple but useful huh?

The next step is to create what we call a proxy. It’s a blank html page that contains nothing more but your regular Google Analytics Code. Call it citricle-ga.html and upload it into your “Live Hosting Files” folder. The trick is that this file is hosted on the checkout.netsuite.com domain, which will allow Google Analytics to parse the cookies from the query string.

Why don’t we use the <NLCHECKOUTURL> ? Pretty simple. After going to the checkout page, NetSuite does a page refresh and reloads without the query string generated by Google Analytics. The first time it loads it (with the query string) it sends out the Location headers before Google’s Analytics script load and that was the main reason why this was so hard to achieve before.

Here’s the code for the citricle-ga.html:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Citricle Google Analytics NetSuite Proxy</title>
</head>

<body>
<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-1579697-1″); //replace UA-1579697-1 with your own account #
pageTracker._setDomainName(”none”);
pageTracker._setAllowLinker(true);
pageTracker._initData();
pageTracker._trackPageview();
</script>
<p>This solution was developed by <a href=”http://www.citricle.com”>Citricle</a>.</p>
</body>
</html>

This is pretty much our unique way of crossing the two domains. After that it’s only a matter of tracking the order on the checkout page. It’s nothing complicated, it was done before and there’s nothing unique about it. It’s just about following Google’s Documentation here.

If you still have any questions, contact us.

Citricle Live Support NetSuite Integration upgraded

Thursday, July 2nd, 2009

To help integrate Citricle Live Support better with NetSuite, we added a couple of very interesting features:

  • Attempt to match the existing entities: with this option enabled, the system will lookup for Netsuite Contacts and Customers and try to match them, so that the generated support case will be under an existing customer, if it matches the right information.
  • Match entities by  Name, Email or Phone: this will be the criteria that the system will use to match the entity. For instance if this option is set to “Email” and the visitor enters an email address that’s already corresponding to an existing NetSuite entity, it will use that entity.
  • Match priority, Customers First or Contacts First: In case the system matches two different types of entities (customers and contacts), this option will give priority to the one you select. So for instance if you got a Customer where the email address is david@example.com, and under it you got a contact for David with the same email, if you choose “Contacts First” the case will be created under the contact, not under the customer record.
  • Case Status ID: this option will choose the default status for the newly created support cases. Although you can customize them, the default status ID’s are:
  1. Not Started
  2. In Progress
  3. Escalated
  4. Re-Opened
  5. Closed
  6. On Hold

Here is a screenshot of the Setup Panel under the Citricle Customer Center:

Configuring Live Support Netsuite Integration

Tuesday, November 11th, 2008

To set up your NetSuite Integration , you need to go to www.citricle.com and log in on the leftside. When you get to the “My Account” section, click CRM Integration on the left. Select Netsuite on Integration Type and you will need to fill in the following information:

  • Your NetSuite account ID. You can find this by logging into NetSuite and clicking Support > Customer Service > Contact Support By Phone
  • Your NetSuite login (email and password).
  • Your Role ID (this needs to be a role that has Full Access to SuiteTalk( Web Services), to customers and to cases.
  • You will also need to provide with a lead status ID. You can find that by going to Setup > Sales > Customer Statuses, click the status you want to be used for the newly created leads and look for the ID in the URL (for example if the url is https://system.netsuite.com/app/crm/sales/customerstatus.nl?id=17, then the ID you are looking for is 17).
  • Click Submit.

Note: If your account is configured not to ask for an email before entering a chat session, a lead will not be created.

Netsuite Integration Setup

Live Support Netsuite Integration

Sunday, October 19th, 2008

Citricle Live Support can always be installed on any website, including NetSuite web stores. However we decided to take the integration with NetSuite to the next level. After enabling the NetSuite Integration feature in our “My Account” section, Live Support can do the following things:

  • Create leads in NetSuite using the information provided by the visitor prior to starting a chat session (Name, Email, Phone). If the system is configured not to ask for an email and phone, the leads won’t be created.
  • If the entered email address matches an email that’s already in your customer database, it will not create a new lead, it will just use the existing lead/customer.
  • If the customer is logged in on the website, in order not to create any duplicate records, it will not create any lead. (NOTE: You will need to set up an additional line of code in your website’s HTML in order for Citricle Live Support to tell if the visitor is logged in or not)
  • Save a copy of the chat conversation into a new support case (status closed) that will be attached to the newly created lead or to the logged in customer.

For a step by step tutorial on how to configure it  go here: Configuring Live Support Netsuite Integration