Oct 30, 2013; 15:34
David Bergkvist
OT: Single page application and Google Analytics
Hi all!
I'm running an commerce site that I built in Lasso 8.6 and are now looking into what Google Analytics can tell me about behavior and conversion on the site. It's a single page application so everything goes through index.lasso on my server and that seems to mess things up on the Google Analytics side.
To track conversion I need to set up goal URLs but that seems to fail since everything happens on index.lasso. I did a trial where I had Lasso do redirect_url but I had an idea about that this must be a chain of pages with the goal URL in the middle so that a refresh by the user on the "end page" don't boost my conversion without any actual sale. That chain would be something like this:
index.lasso (on successful sale redirect_url) --> sale_final.lasso (redirect_url) --> thankyou.lasso
In this chain Lasso makes sure that the sale goes through on index.lasso and when that happens execute a redirect_url to sale_final.lasso.
Sale_final.lasso is set up as a goal URL in Google Analytics (GA) and contain all the code needed to make it count as a page viewed in GA and also a redirect_url to thankyou.lasso.
Thankyou.lasso is just the landing page where the users ends up after he's been through the chain after fulfilling the purchase and he can reload the page as much as he wants to without that changing any statistics in Google Analytics.
The problems I found with this is that since there is a redirect_url run by Lasso on sale_final.lasso I guess the page won't really load in the client browser since the redirect will be set in the header. So I guess that will prevent it from loading Google Analytics and count as a goal.
I did change the redirect_url on sale_final.lasso to be done by meta refresh with a 2 seconds delay before it move on to thankyou.lasso but I can't see that being registered in Google Analytics but that might be due to a delay since I entered that goal earlier today. Think I read something about about a two day delay for new goal URLs.
The other solution I found just now is to have Lasso include a script on the page that is loaded when the sale is final (in my case this could be index.lasso if it only gets included when it's needed), see https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingEcommerce
How do you all track what your users do on a website that is run by a single page application? Track conversions and figure out funnels to goals?
Looking forward to pick your brain on this.
/David
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Oct 30, 2013; 10:50
Paul Melia
Re: OT: Single page application and Google Analytics