Fetch page values dynamically?
I was wondering if anyone could point me in the right direction. We are launching a .NET ecommerce website via nopCommerce 3.5 and want to fully include the Google remarketing code. We've included the Google remarketing code, but it's static - and we put it in the site header and it works - it's on every page, but it's hardcoded and refers to one element on our site.
I am trying to figure out how to do dynamic remarketing code. I. Each page will get its values dynamically via .NET or SQL.
Google remarketing code looks for:
-
ecomm_prodid: 'REPLACE_WITH_VALUE',
(I think this is the product ID) -
ecomm_pagetype: 'REPLACE_WITH_VALUE',
(I think this is the type of page) -
ecomm_totalvalue: 'REPLACE_WITH_VALUE',
(I think this is the total cost)
How can I get each product page to fetch 3 values and place them on the product page instead REPLACE_WITH_VALUE
? (Even if its only one is the product ID)?
We have a lot of products on our site, but maybe I could manually code the top sellers. I do not know how to solve this problem. Any help is greatly appreciated.
source to share
Considering the code of nopCommerce the CodePlex , ProductDetailModel
has a sub-model AddToCartModel
, which, in turn, is a member ProductId
. You must use this field to fill its variable GA follows: ecomm_prodid:'<%#this.AddToCart.ProductId%>';
. The same applies for the price usingecomm_productvalue:'<%#this.ProductPrice.Price%>';
source to share