close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Google Ecommerce

Thread began 1/30/2011 10:41 am by robert329616 | Last modified 1/31/2011 2:16 pm by robert329616 | 871 views | 4 replies |

robert329616

Google Ecommerce

Hello,

I am trying to set up google ecommerce traking for my site.

I added the google tracking code to the receipt page of my site. Where I am a little confused is when I have to add variables to the javascript code in order to pass info (order id, product name, cost, etc) back to google.

Here is the script that google shows in their example:
<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'1234', // order ID - required
'Acme Clothing', // affiliation or store name
'11.99', // total - required
'1.29', // tax
'5', // shipping
'San Jose', // city
'California', // state or province
'USA' // country
]);

// add item might be called for every item in the shopping cart
// where your ecommerce engine loops through each item in the cart and
// prints out _addItem for each
_gaq.push(['_addItem',
'1234', // order ID - required
'DD44', // SKU/code - required
'T-Shirt', // product name
'Green Medium', // category or variation
'11.99', // unit price - required
'1' // quantity - required
]);
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers

(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>

I have searched on this question and all of the responses are vague and suggest that the cart vendor may have a list of variables. I am not sure if this is supported, if so, what are the variables and where would they be inserted in the js code to pass through correctly?

I also tried to search the forums but could not find anything close.

Thanks,
Rob

Sign in to reply to this post

Jason ByrnesWebAssist

On the bindings panel, you find dynamic data bindings that can be used to populate the variables in this scrtipt.

there will be a section in the binding panel for your cart, This is where you can get bindings for product name, price, cart price among others, use those bindings in the script.

Sign in to reply to this post

robert329616

Jason,

I found the bindings panel for WA_Store_Cart when I opened the checkout_form.php file in the plugins folder.

I have two more (hopefully last on this issue) questions: Do I replace the item name between the quotes in the js with <?php echo $WA_Store_Cart->DisplayInfo("Name"); ?>?
And if so the js script resides on checkout_success.php, will this work? I could not find the WA_Store_Cart bindings when I opened this page.

Thanks,
Rob

Sign in to reply to this post

Jason ByrnesWebAssist

yes, that's exactly right.

Sign in to reply to this post

robert329616

Thanks, I'll give it a shot!

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...