Developer forum

Forum » Rapido » Google Impression code problem

Google Impression code problem

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have recently found a problem in Rapido code. 

The helper that adds the google impression code in the checkout, forces a redirect to an URL that does not exist: checkout.html.

See below.

@helper RenderScript() {
<script>
/**
* A function to handle a click on a checkout button. This function uses the eventCallback
* data layer variable to handle navigation after the ecommerce data has been sent to Google Analytics.
*/
dataLayer.push({
'event': 'checkout',
'ecommerce': {
'checkout': {
'actionField': {'step': 1},
'products': [
@foreach (LoopItem orderline in GetLoop("OrderLines"))
{
var groupObject = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(orderline.GetString("Ecom:Product.PrimaryOrFirstGroupID"));
<text>
{
'name': "@orderline.GetString("Ecom:Order:OrderLine.ProductName")",
'id': "@orderline.GetString("Ecom:Product.ID")",
'price': "@orderline.GetDouble("Ecom:Order:OrderLine.UnitPrice.Price")",
'brand': "@orderline.GetString("Ecom:Product:Field.brand.Value")",
'category': "@(groupObject != null ? groupObject.Name : "")",
'variant': "@orderline.GetString("Ecom:Order:OrderLine.ProductVariantID")",
'quantity': @orderline.GetInteger("Ecom:Order:OrderLine.Quantity")
},
</text>
}
]
}
},
'eventCallback': function() {
document.location = 'checkout.html';
}
});
</script>
 
}

Replies

 
Karsten Thuen Dynamicweb Employee
Karsten Thuen
Reply

Hi Adrian

We are aware of this, and the fix should be in the Rapido 3.1 release from last week.

 

Best regards
Karsten Thuen

 

You must be logged in to post in the forum