I'm trying to get Google Analytics eCommerce tracking to play nicely with our site's payment gateway, Worldpay. A solution, which I'd prefer NOT to use has been posted (link below), but involves extra clicks for the shopper, which I was hoping to avoid.
http://www.tatvic.com/blog/google-analytics-worldpay-ecommerce-tracking
The shopper is taken to Worldpay's website to process cards, where no javascript is available and the GA eCommerce tracking breaks down.
Let me walk you through the steps:
A shopper arrives at our site where Google Analytics is set up to successfully track their movements.
The shopper clicks "ORDER" and is taken to Worldpay's website for credit card processing. The shopper completes their order on Worldpay's site and their shopping experience is over.
Worldpay POST us their 'payment response message' which is sent to our designated page 'response.cfm'. This message contains various details about the order (cartID, ammount, etc..) which we file in the database as a completed order.
My question is, and please excuse my ignorance, but is it possible to use this automated payment message, sent to our response.cfm page to send all the GA data to google ? I don't want to involve the user/redirect them back to us, if I can help it.
Worldpay allow us to send our own variables to them, then return the variables in the payment response. I was hoping we could use this feature to make it work? It would be a similar solution to the link above, but wouldn't need the shopper to click the button at the very end (and get a warning message)
I know this is an old question now but as no-one has posted thought it would be worth posting my solution to this problem.
Build a response script which is purely there to handle the response, not display the message, for example response.php. Also create a page which displays a message, for example complete.php
Inside response.php include:
<?php if($_REQUEST["transStatus"] == "Y" && $_REQUEST["testMode"] != "0" && $_REQUEST["callbackPW"] == "your_password"){
//update order status internally here
?>
<meta http-equiv="refresh" content="4; url=complete.php?parameters">
<?php } ?>
Replace "parameters" with any information from the booking you'd like to pass to Analytics. Inside complete.php include your Analytics code referencing to $_GET parameters as required.
For extra security i'd recommend passing an additional parameter with a secret hash (different for every transaction) and compare that in the above if statement as well.
I hope this is a useful solution :)
Related
Looking for a way to set up Google Analytics that help track an organize RFQ's my client receives through their website. I know it can't all be explained in one post (or who would want to), but I am curious if there is a way to track a customers RFQ's in GA. If anyone has any information on this it would be much appreciated.
You can start by using GTM to track the forms they use to submit these RFQs.
You can also go a step further and generate an ID for the RFQ, pass this ID to GA as a custom dimension and also track it in your CRM so later on you can analyze the closing rate from RFQ to buying. If you can provide more details on the mechanisms/processes in your RFQ, we can go into more specifics.
I'm looking for a service that will provide me analytics to prevent click fraud for saving views in a view_counter in a post table. So basically like this:
->Someone visits one of my sites posts
->Analytics service sends me a response that tells me if the view is an organic click, or a robotic click fraud scam
->If the click is organic the view_counter column is incremented on the post table in the database.
Note I don't want to manually hook each post to something that will be able to do this. I would like to automate the task. So when the post is made on my site the service is automatically set up to count those views and send me a response, so I can save it in the database.
I'm looking at some of the I'm looking at some of the reporting APIs, but am unsure what one I would attempt to use and how I would implement this.
Thanks for any help.
I'm not sure it's help but first of all you have to decide what a good session is. For example you can count only sessions with some duration or some user interactions or maybe if user scroll the page.
And then you can make an advanced segment for these sessions and make custom report for all your articles.
Or export your data to Google Sheets and create a table with all your pages and "good sessions" for them.
https://developers.google.com/analytics/solutions/google-analytics-spreadsheet-add-on?hl=en
I would look for some feedback on tracking user activity on an commerce website using th google analytics commerce capabilities.
I can't fully understand those 3 parts :
Adding an item (ecommerce:addItem) : obviously when some user add a thing to the cart
Adding a Transaction (ecommerce:addTransaction) : that's where I'm very confused
Sending the data (ecommerce:send) : that's obvious
Can those 3 event append at a different moment ? in what manner ?
What would be a real-world use case that would make you use execute ecommerce:addTransaction and ecommerce:send at a different moment ?
This thing makes me wonder a lot, and I'd like to have some experienced feedback on this as you tend to easily break your stats if something is not done week enough
Thanks in advance
EDIT
So the main purpose right here is to get stats for the pending orders (you add stuff to your cart), and the complete orders (you paid for the things you added).
Right now I only send it all when the order is complete, and things are working pretty good in analytics, but I just don't know anything about the ones that did not complete.
This question was a lack of knowledge.
Simple ecommerce plugin has nothing to do with the enhanced ecommerce plugin
You won't track that much with the first one, except the checkouts. A plain, one order at a time, revenue value.
If you want a deep insight on your users behaviors (when i say deep, I mean it), You have to go for the second one.
We might be able to debate over the unusefullness of the first one; and the fact that its existence in itself compared to the second is completely misleading, as when you first get in, as usual with google, you get flooded by an endless documentation
ecommerce:addItem does not add items to a cart; it adds items to a transaction (with "conventional" ecommcerce tracking there is no cart tracking, you'd have to use enhanced ecommerce tracking. Actually your title refers to enhanced ("ec:") and your question to conventional ecommerce ("ecommerce:") tracking).
So ecommerce:addTransaction starts a transaction; here goes the stuff that affects the transaction as a whole, like transaction id, tax on the total purchase or shipping costs.
Now that you have started the transaction you can add items to it that are associated via the transaction id.
Finally the ecommerce:send command tells Universal Analytics that the transaction should be processed on the server. "send" is actuall a misnomer; addItem and addTransaction do already send data to the server (they each create an request to the tracking server and thus count towards your hit quota).
The reason for this is, as far as I can tell, that the information is transmitted via url parameters (you call the Google Analytics endpoint which returns an transparent pixel). The maximum length for an url request is limited (actual limits depend on browser and browser version).
So the transaction is broken up into multiple parts not because you want to execute the commands at different moments but so it can be transmitted via Url parameters without being truncated. The send command merely tells that you are now finished adding new parts to the transaction and the data can now be processed.
After taking some online tutorials I am willing to create my own custom theme for my myself. This is going to be an online Contact Lense store! So far I have learned how to generate and use Custom Post Types, Custom Taxonamyies, Metaboxes , and Option pages.but there is still one confusing part left for me(hopefully not more! :-))
I need to get some user inputs through HTML Select Options like following image to finalize the users orders:
Now my question is:
1- Do I have to create some thing lik Metaboxes to manipulate these data from users?
2- can I handle these kind of data through simple Form ans Post function in PHP? If so where should I store these data? Do I have to create a table on my own to handle these things?
I really appreciate your time regrading this post,
What you're asking for carries a little more complexity than you think!
Let's break this down into its meaningful steps:
A user visits your shop, and decides that they like what they see and wants to make an order
The user fills out a form defining their exact eye requirements, quantity, as well as their contact information
Upon completing this form, a new order has been created
But wait.... how will you get paid? What happens if the user's computer explodes before the payment goes through? How will you know to send them their contacts without first knowing the payment even succeeded?
This is where things start to get tricky. You need to be able to keep a record of orders for the sake of your users, but you also need to look out for your own interests too. Your business is doomed to fail if you're sending out expensive products to people without the proper assurance that you're getting paid.
This is where you'll need to set up a Merchant Account with a service like PayPal or Google Checkout. As much as I despise PayPal, their Instant Payment Notification (IPN) System has been very reliable for me. What this does is automatically send a POST request to your server with all of the information you need to finalize the checkout process and alert your user that their payment has either succeeded or failed.
So with this in mind, how does this affect our step-by-step process?
A user visits your shop, and decides that they like what they see and wants to make an order
The user fills out a form defining their exact eye requirements, quantity, as well as their contact information
Upon completing this form, a new order has been created with a status of pending
The user is then sent to PayPal/Google Checkout to enter their Credit Card information to complete their purchase
PayPal/Google processes the payment
PayPal/Google sends your server the results of the processed payment
The corresponding order is updated with a status of Payment Received or Payment Failed for your own records
You send out the product to a very satisfied customer
So what will this mean from a Wordpress standpoint?
My first suggestion:
Check if a Plugin already exists that can handle this for you!!!
Seriously, this will make your life much easier. Handling people's money as well as your own stock is a nightmare all in itself, you don't want to be responsible for handling the code that drives it, or the possibility of security holes that you might not know about (that other plugins may have already addressed). WooCommerce is a popular one. See if that can handle what you need.
If a Plugin can't do it for you, then you'll need to:
Register a Custom Post Type for Orders
Create a new Order Post using wp_insert_post when a user submits the form with their POST data
Save the relevant POST data you need as metadata using update_post_meta
Send PayPal/Google/Whatever some Custom Information it needs to hang on to - in this case, the newly created Order Post ID - so that it can send it back to your own server
Set up a side-script to process the data sent by PayPal/Google Checkout/Whatever and send an email to the user detailing the status of their purchase and update the corresponding Order Post ID that was sent back by PayPal/Google Checkout/Whatever
(Optional) Set up a CRON Job to periodically scan all Pending orders in case a user's session was interrupted, or they bailed at the last second during checkout and send them an email notifying them about this and provide them a link to your website to reopen, reevaluate, and resend the order, or cancel and clear it from your database
Quite honestly, this would take even a seasoned Developer at least a few weeks worth of work just to get it in working condition. Presentation is a whole different animal.
Hopefully this will give you a step in the right direction. I doubt anybody here will give you the code to do what you need, because there's just too much to post. Entire libraries are built just for these kinds of things.
Good luck!
I have a website that allows people to create an account (that is the conversion I wish to track).
I wish to know where a specific person is coming from. I have google analytics installed and have set up the registration page as a goal, but the reporting tells me traffic sources as an aggregated pie chart. It doesn't report down to the user account level to say that 'person with email xyz' came from 'facebook' for example.
What custom variables or mark up would I need to add to GA to report at that detailed level, if that is at all possible?
Otherwise, I will just have to record the first http_referer in a cookie and stick it in a database during the registration process.
Any advice?
Firstly I must ask you, how actionable do you think it is to look at data at that granular of a level? Finding out what % of people who registered came from facebook or some other place is actionable, because it helps you do things like determine where to focus marketing efforts. But individual users? How is this actionable to you? (hint: it's not)
However, if you are still determined to know this, you should first note that it is against Google's ToS to record personally identifiable data both directly (recording the actual value in GA) or indirectly (e.g. - recording a unique id that you can use to tie to personal info stored within your own system). If this is something you don't want to risk, I suggest moving to another analytics tool that does not have this sort of thing in their ToS (e.g. Adobe SiteCatalyst, which costs money, or perhaps you may instead prefer to choose an "in-house" approach, like Piwik)
If you are still determined to follow through with this and hope not to get caught or whatever, Google Analytics doesn't record data like what info a visitor filled out in a form (like their email address) unless you populate that data in a custom field/dimension/metric/event to be sent along with the request. Usually you would populate this on the form "thank you" page (which is usually the same page you use as your goal url or goal event if you're popping and using an event for your goal). So you would populate the email address in one of those custom variables and then have it as a dimension to break down the http referrer by.