I'm using Universal Analytics on my order confirmation page:// Create the trackerga('create', 'UA-XXXXX-Y');// Fire off a pageviewga('send', 'pageview');// Include the ecommerce pluginga('require', 'ecommerce', 'ecommerce.js');// Initialize the transactionga('ecommerce:addTransaction', {             id: '1234abc',     // Transaction ID*    affiliation: 'Tech Shirts', // Store Name        revenue: '52.19',       // Total       shipping: '10',          // Shipping            tax: '3.22'         // Tax});// Add a few itemsga('ecommerce:addItem', {          id: '1234abc',            // Transaction ID*         sku: 'TSHIRT-12A',         // Product SKU        name: 'Analytics Wizard',   // Product Name*    category: 'Men\'s Shirts',      // Product Category       price: '12.99',              // Price    quantity: '1'                   // Quantity});ga('ecommerce:addItem', {          id: '1234abc',            // Transaction ID*         sku: 'TSHIRT-36B',         // Product SKU        name: 'Best Developer',     // Product Name*    category: 'Women\'s Shirts',    // Product Category       price: '12.99',              // Price    quantity: '2'                   // Quantity});// Send off the transactionga('ecommerce:send');For some reason the analytics team have decided to record the same transaction twice if the user refreshes the page.It seems illogical to record the same transaction twice given that transaction ID is the same (it obviously represents the same transaction so why duplicate it?).Is this expected behaviour as it is not documented? Do the GA team really expect every user to have to write code to prevent duplications?
Duplicate transactions in Google Analytics caused by page refreshes
google analytics;universal analytics
Simple JQuery Cookie Solution.  if (!$.cookie('myOrderReference')){//insert analytics code here       $.cookie('myOrderRefernce', true);   }You should setup your script to dynamically insert the order reference instead of 'myOrderReference'.However, if a user loads the order confirmation page into a different browser a duplicate will still occur.