Copy link to clipboard
Copied
Coldfusion Server "CFS"
No Javascript Server "NJS"
1. "CFS" POSTS a form to "NJS"
2. "NJS" processes credit card details and POSTS some info back, via a form, to "CFS" page "receipt.cfm"
3. "receipt.cfm" retrieves form data and passes some of it to Google Tracking cookie, for transmission to Google Analytics servers
My Question:
I'm not sure if part 3 will work - can someone clarify ? My uncertainty is because its a non javascript enabled server posting the form data. Would that mean its effectively requesting a page, "receipt.cfm", from the CFS and executing it on the non-javascript server ? The <script> tag won't be processed ?
Copy link to clipboard
Copied
Dax Trajero wrote:
The <script> tag won't be processed ?
YES it will NOT be processed. JavaScript is a client side techonology. By client side, we mean the system that iniatiates the HTTP request and receives the response from your server. If that client does not enable JavaScript, then any JavaScript <script...> tags in your response that you return to that client will be ignored.
Why would you want a backend credit card processor to be doing anything with Google Analytics Tracking? That is not what Google Analytics is intended to track.
Copy link to clipboard
Copied
RE: Would that mean its effectively requesting a page, "receipt.cfm", from the CFS and executing it on the non-javascript server?
Normally (always from my experience) the server posting the information does not request and execute the page, it simply posts to a predefined location -- the POST handling page -- on the server. If you are expecting the server to request your page and execute the javascript on it, then no the NJS won't be executing this code. But as ilssac already mentioned, why would you want to do this with a payment processing page?
Copy link to clipboard
Copied
Steve Sommers wrote:
Normally (always from my experience) the server posting the information does not request and execute the page, it simply posts to a predefined location -- the POST handling page -- on the server.
To get into the nitty gritty technical communications a POST IS a REQUEST. It is a request that includes a set of key-value pairs to the 'handling page'. And a response will be sent. But at a practical level, as you said, a system, such as a credit card processor, is going to do little to nothing with any response it might get when it sends a POST request to your server (it might not even actually receive the response if it drops the connection).
Copy link to clipboard
Copied
ilssac wrote:
...POST IS a REQUEST.
Good catch. I think of details like this in logical terms not technical ones but I do see the different translation of the original question now. I translated the "request" as the downloading of the form and the server acting on the form by posting data. Now I see that the "request" was probably referring to the page returned by the POST request.
Copy link to clipboard
Copied
Hi Guys. Thanks for the responses. Let me try and explain the reason I asked the question.
Payment Gateway
We currently use Worldpay, which has the order confirmation page on their server. The shopper is sent over there to process their credit card details. As far as the shopper is concerned that's where the story ends.
Coldfusion Server (hosting eCommerce site)
So how do we know the shopper completed the transaction ? That their credit card cleared (or failed) ? The answer is Worldpay send a 'payment response', which is essentially a summary of the order (orderID, ammount, etc) This gets posted to our CF server.
So what does all this have to do with the original question ? Well, we utilise Google Analytics eCommerce tracking (cookie), which needs to be told when an order has completed. Obviously we can't run that on the Worldpay server, so I'm looking into receiving the payment response from Worldpay, breaking it down, passing the relevant info to the Google cookie, who'll transmit it back to Google Analytics servers.
Really, I'm trying to work out in my head just who is executing the receipt.cfm page I mentioned (is it the CF Server or the Non Javascript/Worldpay Server?). This is the page that Worldpay's 'payment response' sends the order summary to. I need to know if the <script> section that Google Analytics eCommerce tracking uses, will be executed properly?
Copy link to clipboard
Copied
I don't know the Google Analytics API but you should be able to create some server side code that sends Google what it needs. The server side code would reside on your server and be executed within your receipt.cfm page. But again, I don't know the Google API some I'm not 100% sure this is doable (or at least "easily" doable).
Copy link to clipboard
Copied
Dax Trajero wrote:
Hi Guys. Thanks for the responses. Let me try and explain the reason I asked the question.
I'm trying to work out in my head just who is executing the receipt.cfm page
Define "executing"
Normal CFML processing.
How does that change for a third party server, such as a Credit Card processor.
Answer NOT MUCH.
I do not know how this Google Analytics "eCommerce" tracking works. I just use Google Analytics which is ALL JavaScript that is expected to be processed by a client browser. There are NO browsers doing any work in the communications between the credit card processor and ColdFusion.
But, if you can provide some insight into how you communicate data to Google Analytics we can try to help. Just note that cookies and JavaScript are client technologies meant to be executed in a browser.
Copy link to clipboard
Copied
By 'executing' I'm referring to the <script> element on the order receipt page. This page sits on the CF server.
Non javascript server POSTS an order summary to the CF Server's order receipt page
Job of the order receipt page is to process the form sent to it and send Google Analytics eCommerce tracking info back to Google. This takes the form of a <script> tag on the page.
It's the script tag that I assume will not be processed during this server-to-server exchange, as its a browser based technology isn't it ?
Google Analytics eCommerce script info here:
http://code.google.com/apis/analytics/docs/tracking/gaTrackingEcommerce.html
Long shot question - If it won't work using above method, is there a way for Coldfusion to process the <script> tag on the page ? ie. pretend to be a browser?
Copy link to clipboard
Copied
Dax Trajero wrote:
It's the script tag that I assume will not be processed during this server-to-server exchange, as its a browser based technology isn't it ?
Correct. There is little to no chance that the credit card processor that posted the data is going to process any JavaScript, it is not using a browser.
Dax Trajero wrote:
ie. pretend to be a browser?
WELL...... ColdFusion does have a built in 'browser' that it uses for <cfhttp...> and similar tasks. But, it is a very rudementary browser and IT IS NOT going to process JavaScript.
What Google is expecting you to do is provide this JavaScript code on some type of resutls page that is being returned to the original user's client browser.
Copy link to clipboard
Copied
WELL...... ColdFusion does have a built in 'browser' that it uses for <cfhttp...> and similar tasks. But, it is a very rudementary browser and IT IS NOT going to process JavaScript.
What Google is expecting you to do is provide this JavaScript code on some type of resutls page that is being returned to the original user's client browser.
Yes, exactly, Google is expecting the shopper to be taken to an "order complete" page, and the Google script will be processed by the shoppers browser.
I'm wondering if there's a way AROUND this.
What I've done so far is break down all the info stored in the Google Analytics cookies, where I can save them in Coldfusion format - perhaps a session variable or perhaps database fields in table
I can have Coldfusion wait for the payment response telling me the shoppers card has worked
I can then reconstruct the Google Analytics cookies and send them off to Google. Just not sure how I can do this last bit without a shoppers browser. I've got to get my head around how Google get the cookie to transfer the data back to base. I think they send a GIF request and pass the parameters with the request. This would be doable with the aforementioned server to server exchange wouldn't it ? (no need for a shopper's browser to process any javascript as we've removed it from the equation so to speak)
Copy link to clipboard
Copied
I'm still not clear on where you think the human that is interacting with your website is going to end up at the end
of all this. I would think that whatever page that you want the user to see after the transaction is completed
is where you would put the Google snippet.
You also seem to be mixing up concepts involving Cookies and how GA works, when you talk about "storing" the GA cookies and then "sending" them to GA when you get the confirmation. Any cookies that the user has from GA will have been created by GA, so how do you plan on accessing them?
However, if you want to try to make things happen as you are describing, then maybe try this: Create a CFM page that has the Google tracking snippet on it. After the Google JS code put in another piece of JS code that sets document.location to be whatever page you want the user to end up on. This way the Google code will get executed on a browser, and the user will end up on your final page. Similar in concept to a CFLOCATION, but I don't think that CFLOCATION will work because the JS on the code containing the CFLOCATION won't get executed (because CFLOCATION does redirect in the header).
But I still don't see why you think you need to execute the Google code on your server instead of the browser. The CFM page only gets executed because the user did something on some page, and has to end up somewhere else when that is done, so why not put the tracking there? If you are returning the user to a page before the credit card confirmation comes back, then you might want to rethink that process. If the page that started the transaction with the gateway completes before the gateway responds, how are you going to find out the completion status? There won't be a page executing on the CF server anymore. If you DO wait for the completion from the gateway, then you just put the Google snippet on that page so that when you go back to the user it executes in the user's browser and posts the info to GA. If the gateway doesn't approve the transaction, then you don't include the Google snippet, or else you include a different one so that you can track both approvals and declines through GA.
-reed
Copy link to clipboard
Copied
Dax Trajero wrote:
Yes, exactly, Google is expecting the shopper to be taken to an "order complete" page, and the Google script will be processed by the shoppers browser.
IT IS NOT VERY ADVISABLE to NOT do what Google expects. If you read ANY of their EULAs, you will find they are chock full of language that will tell you they will be very happy to cut off your account(s) with them if you do NOT follow the rules as they have spelled them out.
If the JavaScript IS NOT processed by a shoppers browser, it is NOT going to be sending the data Google is expecting. YOU DO NOT have all the data Google has exchanged with the client's browser. When you put Google Analytic's code into a browser, that creates a direct connection between Google's systems and the Client system that your system has no part in.
To try and put a final opinion on this discussion.
YOU CAN NOT DO WHAT YOU WANT TO DO ... with any technology of which I know.
What I DO NOT KNOW is what Google allows you to do. There is a possibility that Google has some API where you can directly submit data like this to their systems. But the place to find that Answer is probably Google OR some forum specializing in Google Systems.
Copy link to clipboard
Copied
OK, I'll head off to Google Analytics website and see if I can find out more info there.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more