Checkoutcomplete page for analytics tracking


https://forum.kartris.com/Topic7041.aspx
Print Topic | Close Window

By SAbow - Thu 26 Apr 2018
Hi,

I'd like to easily track completed orders in analytics tools. I see that the newer version of kartris no longer displays last URL as checkoutcomplete.aspx, instead it all show as checkout.aspx and uses server.transfer to load inner page within the page. Why was this done? and how would you suggest defining complete order page when checkout.aspx can be one of 4 steps in the order process (login & basket/shipping/billing/confirmation) - how can I differentiate to track between all these steps if they are all under one URL?

Please advise,
Thanks for any assistance,
By Paul - Thu 26 Apr 2018
It depends what payment system you're using. Most that go to remote payment pages (hosted by gateway vendors), e.g. Paypal, Sagepay, Worldpay... will return users back to the Kartris store CheckoutComplete.aspx page. And that will run Google Analytics code there (it cannot run in the callback, because that's called by most of them directly, whereas GA code needs to run in the user's browser, hence we have to wait until the user returns to the site).

Google Analytics lets you track events. We have used this on other custom projects we've done for clients (not Kartris) to track when particular buttons are pushed. I assume it should be possible to push events even on a single page that handles multiple stages, by putting a javascript push into each section.

https://developers.google.com/analytics/devguides/collection/analyticsjs/events
By SAbow - Tue 1 May 2018
just using Authorize.net to process payment and staying on the website the whole time. How should analytics differenciate between step 1 of checkout and its successful completion??

Please advise,
By SAbow - Wed 16 May 2018
You can add this code to the Checkout.aspx page


<script>
<%
If mvwCheckout.ActiveViewIndex = 0 Then
%>
window.location.hash = 'login';
<%
ElseIf mvwCheckout.ActiveViewIndex = 1 Then
%>
window.location.hash = 'step1';
<%
ElseIf mvwCheckout.ActiveViewIndex = 2 Then
%>
window.location.hash = 'step2';
<%
End If
%>
</script>



and in Checkout.aspx.vb, change Server.Transfer("CheckoutComplete.aspx")
to
Response.Redirect("CheckoutComplete.aspx")



Then these are the urls for each step of checkout:

These are the urls for each stepof checkout:

View basket contents
https://websitename.com/Basket.aspx

if not logged in yet – must log in before checking out
https://websitename.com/Checkout.aspx#login

enter billing/shipping address, shipping methods
https://websitename.com/Checkout.aspx#step1

enter payment options
https://websitename.com/Checkout.aspx#step2

thank you page
https://websitename.com/CheckoutComplete.aspx