Ecommerce tracking without GA plugin version 3.20

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hello everyone,
Can someone help me out with adding ecommerce tracking without using the GA plugin? We are on version 3.20 and have a lot of custom coding and every time I try to active the GA plugin the site crashes.

I just want to know if anyone has used a datalayer on the completed page with google tag manager or a ga ecommerce tag without using tag manager.

I have tried it like this with tagmanager and get nothing.
<script>
dataLayer = [{
    'transactionId': '{ORDERID}', // Transaction ID - Type:String - Required
    'transactionAffiliation': '{SITE}', // store name - Type:String - Optional to use
    'transactionTotal': {TOTAL}, //total revenue - Type:Numeric - Required
    'transactionTax': {TAX}, // Tax amount for transaction - Type:Numeric - Optional to use
    'transactionShipping': {SHIP}, // Shipping cost - Type:Numeric - Optional to use
    'transactionProducts': [{
        'sku': '{PRODUCTSKU}', // Product SKU - Type:String - Required
        'name': '{PRODUCTNAME}', // Product Name - Type:String - Required
        'category': '{CATEGORYNAME}', // Product Category - Type:String - Optional to use
        'price': {UNITPRICE}, // Product Price - Type:Numeric - Required
        'quantity': {QUANTITY} // Product Quantity - Type:Numeric - Required
    },{
        'sku': '{PRODUCTSKU}', // Product SKU - Type:String - Required
        'name': '{PRODUCTNAME}', // Product Name - Type:String - Required
        'category': '{CATEGORYNAME}',  // Product Category - Type:String - Optional to use
        'price': {UNITPRICE}, // Product Price - Type:Numeric - Required
        'quantity': {QUANTITY} // Product Quantity - Type:Numeric - Required
    }]
}];
</script>


Thanks for any help you can send my way.
Bob
6 years ago
Boblyng wrote:
Hello everyone,
Can someone help me out with adding ecommerce tracking without using the GA plugin? We are on version 3.20 and have a lot of custom coding and every time I try to active the GA plugin the site crashes.

I just want to know if anyone has used a datalayer on the completed page with google tag manager or a ga ecommerce tag without using tag manager.

I have tried it like this with tagmanager and get nothing.
<script>
dataLayer = [{
    'transactionId': '{ORDERID}', // Transaction ID - Type:String - Required
    'transactionAffiliation': '{SITE}', // store name - Type:String - Optional to use
    'transactionTotal': {TOTAL}, //total revenue - Type:Numeric - Required
    'transactionTax': {TAX}, // Tax amount for transaction - Type:Numeric - Optional to use
    'transactionShipping': {SHIP}, // Shipping cost - Type:Numeric - Optional to use
    'transactionProducts': [{
        'sku': '{PRODUCTSKU}', // Product SKU - Type:String - Required
        'name': '{PRODUCTNAME}', // Product Name - Type:String - Required
        'category': '{CATEGORYNAME}', // Product Category - Type:String - Optional to use
        'price': {UNITPRICE}, // Product Price - Type:Numeric - Required
        'quantity': {QUANTITY} // Product Quantity - Type:Numeric - Required
    },{
        'sku': '{PRODUCTSKU}', // Product SKU - Type:String - Required
        'name': '{PRODUCTNAME}', // Product Name - Type:String - Required
        'category': '{CATEGORYNAME}',  // Product Category - Type:String - Optional to use
        'price': {UNITPRICE}, // Product Price - Type:Numeric - Required
        'quantity': {QUANTITY} // Product Quantity - Type:Numeric - Required
    }]
}];
</script>


Thanks for any help you can send my way.
Bob


I have ecommerce tracking setup on a very very very old version of nopcommerce 1.90. it doesn't use a ga plugin or tag manager, its all hard coded on the pages (webforms). It does look different than what you've got here but again, its not using tag manager.
6 years ago
Can you post the example of the tag that doesn't support tag manager?

I can see if I can get it to work from that or I will remove tag manager and run it the old way.

Thank You
Bob
6 years ago
Boblyng wrote:
Can you post the example of the tag that doesn't support tag manager?

I can see if I can get it to work from that or I will remove tag manager and run it the old way.

Thank You
Bob


I suppose it would be considered the 'old' way as it just calls the ga() methods to set properties etc.

for example (minus the fluff)...



StringBuilder sb = new StringBuilder();

sb.Append("ga('require', 'ec'); ");
sb.AppendFormat("ga('set', '&cu', '{0}'); ", order.CustomerCurrencyCode);

string productFormat = "'id': '{0}', 'name': '{1}','brand':'{2}', 'variant': '{3} (Size:{4})', 'price': '{5}', 'quantity': '{6}'";


// loops over a list of products, uses the productFormat string above and...

// add your values
string productObj = string.Format(productFormat,...);

sb.AppendFormat("ga('ec:addProduct',{{{0}}}); ", productObj);


// we use different props depending on order criteria but essentially it looks similar to this
string headerFormat = "ga('ec:setAction', 'purchase', {{'id': '{0}', 'revenue': '{1}', 'tax': '{2}', 'shipping': '{3}', 'affiliation': '{4}'}});";

// add your values to the action
sb.AppendFormat(headerFormat,...);

// send
sb.AppendFormat("ga('send', 'event', 'Order confirmation', 'Successful payment', '{0}');",order.OrderId);




p.s. i think it takes 24 hours for stats to show.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.