Categories: Discuss Tracking and Implementation issues :

Ecommerce tracking - Condensing script and stopping the bank showing up as referrer! Pesky!!!

Showing 1-2 of 2 messages
Ecommerce tracking - Condensing script and stopping the bank showing up as referrer! Pesky!!! toolsandtimber 7/6/12 2:39 AM
Hi guys, we have a coldfusion website with a secure payment gateway.

The first issue is that the bank is showing as the referrer, not the original referrer ie google, direct etc. I have added in a specific domain to the tracking code but it still doesn't pick up the original gateway as it bounces back from the customers bank through the checkout process. Can anyone help please?

As we have  implimented ecommerce tracking as well as normal tracking do we need all this code still? We have both the standard and ecommerce codes and what looks to be extra javascript for some reason!

<script type="text/javascript">
 
var _gaq = _gaq || [];
  _gaq
.push(['_setAccount', 'UA-XXXXXXX-1']);
  _gaq
.push(['_trackPageview']);

 
(function() {
   
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga
.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
   
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
 
})();
</script>

<script type="text/javascript">
 
var gaJsHost = (("https:" == document.location.protocol ) ? "https://ssl." : "http://www.");
  document
.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>


   
<!---<script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape(""));
    </script>--->


   
<script type="text/javascript">
   
try {
       
//alert(1);
   
var pageTracker = _gat._getTracker("UA-XXXXXXX-1");
    pageTracker
._setDomainName('toolsandtimber.co.uk');
    pageTracker
._setAllowLinker(true);
    pageTracker
._trackPageview();
   
<!--- payment done page --->
<cfif request.thisPage contains 'payment_done.cfm'
AND isdefined
("request.confirmationQuery")>
<!--- GWW [start]: Google Analytics transaction code : 2/19/2010 --->

<!--- Get order total (all products) --->
   
<cfset request.productTotal = 0>
   
<cftry>
       
<cfloop list="#valueList(request.confirmationQuery.ordersku_skutotal)#" index="pp">
           
<cfset request.productTotal = request.productTotal + pp>
       
</cfloop>
    <cfcatch></
cfcatch>
   
</cftry>
    <cfoutput>
        pageTracker._addTrans(
        "#request.confirmationQuery.order_ID#",
        "G&S Specialist Timber",
        "#request.producttotal#",
        "#request.confirmationQuery.order_tax#",
        "#request.confirmationQuery.order_shipping#",
        "#request.confirmationQuery.order_city#",
        "#request.confirmationQuery.order_state#",
        "#request.confirmationQuery.order_country#"
        );
    </
cfoutput>
 
<cfoutput query="request.confirmationQuery" group="orderSKU_SKU">
   
<!--- get the category name for each product --->
   
<cfparam name="getCatName" default="">
   
<cftry>
       
<!--- get category name --->
   
<cfquery name="rsgetProductCat" datasource="#request.dsn#" username="#request.dsnUsername#" password="#request.dsnPassword#">
        SELECT category_ID as catID
, category_Name as catName
        FROM tbl_prdtcategories
        INNER JOIN tbl_prdtcat_rel
        WHERE tbl_prdtcat_rel
.prdt_cat_rel_Cat_ID = tbl_prdtcategories.category_ID
        AND tbl_prdtcat_rel
.prdt_cat_rel_Product_ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#request.confirmationQuery.product_ID#" />
       
</cfquery>
        <!--- set id and name as variables --->
        <cfset productCat.catID = rsGetProductCat.catID>
        <cfset productCat.catName = rsGetProductCat.catName>
        <!--- if error set cat name to null --->
    <cfcatch>
        <cfset productCat.catName = ''>
    </
cfcatch>
   
</cftry>
  pageTracker._addItem(
    /
/ Order ID
   
"#request.confirmationQuery.order_ID#",
   
// SKU
   
"#SKU_MerchSKUID#",
   
// Product Name
   
"#request.confirmationQuery.product_name#",
   
// Category
   
"#productCat.catName#",
   
// Price
   
"#orderSKU_UnitPrice#",
   
// Quantity
   
"#orderSKU_Quantity#"
 
);
 
</cfoutput>
  pageTracker._trackTrans();

</
cfif>
   
} catch(err) {console.log(err);}</script>


Re: Ecommerce tracking - Please Help!! Bank showing up as referrer! Pesky!!! toolsandtimber 7/7/12 5:33 AM
Please can someone help!