Hi, wondering if anyone would be able to assist, we are looking to pass a product id into a zaraz variable using track (and previously set) unsuccessfully using 2 different approaches below:
zaraz.track('Product Viewed', { product_id: '123456', name: 'Actual Product Name', price: 100.00, currency: 'gbp', }); zaraz.track('product_id', '123456', {scope: 'page'}); zaraz.track('product_name', 'Actual Product Name', {scope: 'page'}); zaraz.track('product_price', '100.00', {scope: 'page'}); Neither are passing the variable for use in 3rd party scripts (pinterest) for this example - must be doing something wrong here, if I set the variable manually to 1234 it shows up in the pinterest debug tool, the zaraz debug console always comes back: {{ client.product_id }} is empty All assistance greatly appreciatedapologies the code examples merged together, this should read like this:
zaraz.track(‘Product Viewed’, { product_id: ‘123456’, name: ‘Actual Product Name’, price: 100.00, currency: ‘gbp’, }); zaraz.track(‘product_id’, ‘123456’, {scope: ‘page’});
zaraz.track(‘product_name’, ‘Actual Product Name’, {scope: ‘page’}); zaraz.track(‘product_price’, ‘100.00’, {scope: ‘page’});
You didn’t mention what tool you’re trying to pass the information to
Hi and thanks for replying to my question - I’m trying to pass a product id using zaraz from a product view page on our magento ecommerce site to the pinterest tag (or any other such like google remarketing, bing remarketing, tiktok) via a zaraz variable, however the variable is always returning back blank when using the set and track code methods shown above
Kind regards
I’m sorry but I don’t understand what you’re trying to do.
First, Zaraz Ecommerce is supported only on specific tools. You have to enable it in the tool “Settings” page.
Second, zaraz.track
, zaraz.set
and zaraz.ecommerce
are not supposed to return anything. What do you expect them to return?