Shopsite 11 with Google Universal Analytics

General ShopSite user discussion

Shopsite 11 with Google Universal Analytics

Postby kiltym » Wed Jun 11, 2014 9:54 am

Hi,

We are running SS 11 sp2 r4 Manager.

We only use the ecommerce pages within Shopsite, no product pages. The cart, thankyou, confirm, etc....

I know that SS12 supports Universal Analytics, but we don't really want to upgrade just for this requirement.

I want to change the analytics script to use the analytics.js (Universal) instead of ga.js. And I also want to maintain our ecommcerce tracking from SS to Google that is inserted on the ThankYou page by SS.

What I want to do is be able to modify the script that is located on ShopSite > Merchandising Tools > Google Services > Google Analytics Configuration. But, the field is not editable.

So, where I can go into SS (behind the scenes), and change this script manually?

One option is to turn off GA within SS, and add the script to each page manually, however I will lose the ecommerce reporting if I take this approach, and would like to keep that working.

Any suggestions?

Thanks,
Mark
kiltym
 
Posts: 38
Joined: Tue Dec 08, 2009 12:00 pm
Location: MA

Re: Shopsite 11 with Google Universal Analytics

Postby loren_d_c » Wed Jun 11, 2014 11:22 am

No, you can't edit the Google Analytics code used by ShopSite, it is compiled into the executables. You would have to upgrade to ShopSite 12 in order to use Universal Analytics with ShopSite's Google Analytics integration.

-Loren
loren_d_c
 
Posts: 2570
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Shopsite 11 with Google Universal Analytics

Postby kiltym » Wed Jun 11, 2014 7:11 pm

But this is not really accurate.

I can disable google analytics in SS, and add the Universal Analytics script to the footer on each page, and that will work fine, I would think.

Isnt that correct?

Who can I contact, or where can I find, information about upgrading, both regarding cost as well as the process involved?

I can understand the ecommerce script not working as that is "injected" into the page when it is rendered.

Thanks,
Mark
kiltym
 
Posts: 38
Joined: Tue Dec 08, 2009 12:00 pm
Location: MA

Re: Shopsite 11 with Google Universal Analytics

Postby kiltym » Wed Jun 11, 2014 7:22 pm

I also refer any other user to:

http://www.shopsite.com/help/11.2/en-US/sc/mgr/index.htm?page=/help/11.2/en-US/sc/mgr/analytics.html

Which describes how to add custom script to the necessary pages manually, which is what I was trying to do. Note this is not specifically for Universal Analytics, but the concepts are the same, just the scripts from Google are different.

The javascript for the ecommerce section needs to be modified to support the new format, and once I have that working I will post here for others as it should not be a big deal to make work with Universal Analytics.

Mark
kiltym
 
Posts: 38
Joined: Tue Dec 08, 2009 12:00 pm
Location: MA

Re: Shopsite 11 with Google Universal Analytics

Postby robm » Thu Jun 12, 2014 5:35 am

Mark,

We posted a tutorial on our website for manually adding Universal analytics:

http://support.lexiconn.com/news/forums/topic/manually-adding-universal-analytics-to-your-site/

Hope this helps. :)

Rob
robm
 
Posts: 463
Joined: Fri Aug 04, 2006 5:46 pm
Location: Connecticut

Re: Shopsite 11 with Google Universal Analytics

Postby kiltym » Thu Jun 12, 2014 6:35 am

Rob,

Thanks! Saves me the of effort to figure out the ecommerce portion.

Appreciate the help, and I am sure this will be useful for others needing to do the same.

Mark
kiltym
 
Posts: 38
Joined: Tue Dec 08, 2009 12:00 pm
Location: MA

Re: Shopsite 11 with Google Universal Analytics

Postby kiltym » Fri Jun 13, 2014 6:50 am

Again, thanks for the link and the write-up.

I have found one issue, and not sure there is an easy workaround for it.

We use a shared SSL, so ideally we use the cross-domain tracking code.

In our SS, the shopping cart is not https (not sure if the shopping cart can be configured to use https), so it uses our standard domain. When the user clicks on "Checkout", they are then taken to the "Checkout" page which is https, and in turn, our hosting providers domain.

The issue is that the "autolinker" code that Google provides only works if the source page (shopping cart) contains links/refs to the destination domain (the checkout page). The action taken by the shopping cart page when the checkout button is pressed however is to re-submit the page to itself (action="http://www.-.com/store/sc/order.cgi"), at which point some server-side scripts is most likely invoked and the user is then redirected to the secure check out page. But, because of this behavior, the Google scripts cannot perform their function since there are no direct references to the https (and our hosting domain).

So, there does not seem to be a way to pass the required _ga "decoration" to allow cross domain tracking.

If anyone has suggestions.......?

Thanks,
Mark
kiltym
 
Posts: 38
Joined: Tue Dec 08, 2009 12:00 pm
Location: MA

Re: Shopsite 11 with Google Universal Analytics

Postby kiltym » Fri Jun 13, 2014 7:36 am

I am also trying to add the ecommerce tracking code, but it is having an issue.

The script from both the SS example, and the lexiconn examples have script that references variable I do not see in my ThankYou page, and I suspect that is causing the issue.

For example (from lexiconn):

document.write("ga('ecommerce:addTransaction', {" + "'id':'" + ss_ordernum +"', 'affiliation':'" + ss_associate + "','revenue':'" + ss_ordertotal + "','shipping':'" + ss_shiptotal + "','tax':'" + ss_taxtotal + "'});");

At the top of my thankyou.cgi page, only the following fields are defined:

var ss_ordernum = "3411";
var ss_ordertotal = "408.81";
var ss_subtotal = "365.00";


So, why is my thankyou.cgi page not including the other variables (ie. ss_associate, ss_shiptotal, etc...) needed by the ecommerce scripts?

Thanks,
Mark
kiltym
 
Posts: 38
Joined: Tue Dec 08, 2009 12:00 pm
Location: MA

Re: Shopsite 11 with Google Universal Analytics

Postby Jim » Fri Jun 13, 2014 7:45 am

The Pro level of ShopSite has all the cart javascript variables, the Manager level has a limited number of them. See the help pages for the two products
Manager - http://www.shopsite.com/help/11.2/en-US/sc/mgr/cart.variables.html
Pro - http://www.shopsite.com/help/11.2/en-US/sc/pro/cart.variables.html
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Shopsite 11 with Google Universal Analytics

Postby kiltym » Fri Jun 13, 2014 7:48 am

Jim wrote:The Pro level of ShopSite has all the cart javascript variables, the Manager level has a limited number of them. See the help pages for the two products
Manager - http://www.shopsite.com/help/11.2/en-US/sc/mgr/cart.variables.html
Pro - http://www.shopsite.com/help/11.2/en-US/sc/pro/cart.variables.html


Thanks Jim,

This link:
http://www.shopsite.com/help/11.2/en-US/sc/mgr/index.htm?page=/help/11.2/en-US/sc/mgr/analytics.html

Shows the scripts using all the variables......?

So I guess this is wrong?

So, the only way to use the manual scripts described is with the "Pro" version?

Mark
kiltym
 
Posts: 38
Joined: Tue Dec 08, 2009 12:00 pm
Location: MA

Re: Shopsite 11 with Google Universal Analytics

Postby kiltym » Fri Jun 13, 2014 8:38 am

robm wrote:Mark,

We posted a tutorial on our website for manually adding Universal analytics:

http://support.lexiconn.com/news/forums/topic/manually-adding-universal-analytics-to-your-site/

Hope this helps. :)

Rob



Also a comment on the ecommerce code on your post:

for (var p = 0 ; p < number_products ; p++) {
document.write("ga('ecommerce:addItem', {" + "'id':'" + ss_ordernum +"', 'name':'" + ss_name + "','sku':'" + ss_sku + "', 'category': 'product', 'price':'" + ss_price + "','quantity':'" + ss_quantity + "'});");
}

It would see this is not accurate as the index "p" is not used when each item is added to the ecommerce cart. The variables ss_name, ss_sku, etc are most likely arrays and need to be indexed to accurately fill in the "addItem" call.

This is from the example from SS:

for (var p = 0 ; p < number_products ; p++) {
document.write("UTM:I|" + ss_ordernum + "|" + ss_sku[p] + "|" + ss_name[p] + "|Products|");
document.write(ss_price[p] + "|" + ss_quantity[p] + "\n");
}

Mark
kiltym
 
Posts: 38
Joined: Tue Dec 08, 2009 12:00 pm
Location: MA

Re: Shopsite 11 with Google Universal Analytics

Postby Jim » Fri Jun 13, 2014 11:25 am

Mark thanks for pointing out the help problem of Manager help containing javascript variables not available in the Manager product. I have notified the documentation team to fix the help page.

You are correct that the complete analytics code using javascript can only be implemented in a Pro store, since it requires variables not available in Manager level stores.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Shopsite 11 with Google Universal Analytics

Postby kiltym » Fri Jun 13, 2014 11:39 am

Jim wrote:Mark thanks for pointing out the help problem of Manager help containing javascript variables not available in the Manager product. I have notified the documentation team to fix the help page.

You are correct that the complete analytics code using javascript can only be implemented in a Pro store, since it requires variables not available in Manager level stores.



That is unfortunate since the cost to upgrade to Pro is substantial. I am only trying to maintain our current integration with Universal Analytics since at some point the older version of Google Analytics will be deprecated, and the only route is to either upgrade to V12 or upgrade to the Pro version is would seem.

I can understand wanting to offer more powerful customization with the "Pro" version, but it would seem now that the only way to implement eCommerce integration with Google is via these variables which are not available. Perhaps this is something that could be rolled out to Manager versions in order to provide a way to maintain current functionality with Google Analytics.
kiltym
 
Posts: 38
Joined: Tue Dec 08, 2009 12:00 pm
Location: MA

Re: Shopsite 11 with Google Universal Analytics

Postby robm » Fri Jun 13, 2014 1:10 pm

kiltym wrote:
robm wrote:Mark,

We posted a tutorial on our website for manually adding Universal analytics:

http://support.lexiconn.com/news/forums/topic/manually-adding-universal-analytics-to-your-site/

Hope this helps. :)

Rob



Also a comment on the ecommerce code on your post:

for (var p = 0 ; p < number_products ; p++) {
document.write("ga('ecommerce:addItem', {" + "'id':'" + ss_ordernum +"', 'name':'" + ss_name + "','sku':'" + ss_sku + "', 'category': 'product', 'price':'" + ss_price + "','quantity':'" + ss_quantity + "'});");
}

It would see this is not accurate as the index "p" is not used when each item is added to the ecommerce cart. The variables ss_name, ss_sku, etc are most likely arrays and need to be indexed to accurately fill in the "addItem" call.

This is from the example from SS:

for (var p = 0 ; p < number_products ; p++) {
document.write("UTM:I|" + ss_ordernum + "|" + ss_sku[p] + "|" + ss_name[p] + "|Products|");
document.write(ss_price[p] + "|" + ss_quantity[p] + "\n");
}

Mark

Thanks for the catch Mark - Bad copy and paste - We'll get that corrected. Yes, individual items should be an array. :)

Rob
robm
 
Posts: 463
Joined: Fri Aug 04, 2006 5:46 pm
Location: Connecticut

Re: Shopsite 11 with Google Universal Analytics

Postby Courtney » Tue Sep 30, 2014 1:12 pm

So, there is no way to track eCommerce from the "Thank You Screen" using Universal Google Analytics without either a) upgrading to v12 or b) upgrading to Pro ?

Is this correct?

I tried using the code found here: http://support.lexiconn.com/news/forums/topic/manually-adding-universal-analytics-to-your-site/

Is there an Universal Ecommerce code that works with ShopSite 11 Manager (Not Pro)?

Thanks!
Courtney
 
Posts: 1
Joined: Tue Sep 30, 2014 1:06 pm


Return to User Forum

Who is online

Users browsing this forum: Google [Bot] and 83 guests