1b.app
Link copied -

Replacing the variable in the IM template in the code insertion block

there is a script for inserting the product card page in the online store template https://stingray.ua/admin/shop/grid/product/
here is this script:
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'ecomm_pagetype': 'product',
'ecomm_prodid': '6437-ua',
'ecomm_totalvalue': 590.0000});
</script>
for it to work, you need to replace the variables for the product id and its price, but I'm not sure if I did it correctly:
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'ecomm_pagetype': 'product',
'ecomm_prodid': '[id]',
'ecomm_totalvalue': [price]});
</script>
tell me if I specified the variables in the script correctly?
https://i.imgur.com/WVbhvXK.png
Original question is available on version: ua

Answers:


Mazur Viktor Viktorovich
SheBo wrote:
Tell me, am I correct in entering the changes in the script?

to check this you just need to go to the site, open the page code, find there 'ecomm_pagetype': 'product', and below will be
'ecomm_prodid': '[id]',
'ecomm_totalvalue': [price]});
here in these places or replaced the price and product id (which means that you replaced it correctly)
or the same [] will remain, which means that the variables do not work there. This is js, you can see it yourself on the page
25.09.2023, 21:11
Original comment available on version: ru


Department of Care
OneBox production wrote:

Viktor Viktorovych Mazur
SheBo wrote:
tell me, am I correct in specifying the variables in the script?

to check it, you just need to go to the site, open the page code, find there 'ecomm_pagetype': 'product', and below will be
'ecomm_prodid': '[id]',
'ecomm_totalvalue': [price]});
in these places, the price and product id have been replaced (which means that you have replaced them correctly)
or will remain the same [] which means that the variables do not work there. This is js, you can see it yourself on the page

soooo i forgot, thanks! I don't know what came over me :D
good mood :)
25.09.2023, 21:20
Original comment available on version: ua


Department of Care
OneBox production wrote:
window.dataLayer = window.dataLayer

can I still find out which variables I need to look for for this? From which list?
25.09.2023, 21:23
Original comment available on version: ua


Mazur Viktor Viktorovich
SheBo wrote:
I forgot sooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo I don't know what came over me :D
I'm in a great mood :)

mutually
{|$dynx_itemid|}
{|$dynx_pagetype|}
{|$dynx_totalvalue|}
[[arg_xxx]] - where xx is any argument value from the page
{|$orderId|} - on the page after creating an order
{|$productcount|} - same place.
everything seems to be +-. On the product page you can still do everything that is networked into the product block, but there internal variables need to be printed separately directly, you hardly need them
25.09.2023, 22:10
Original comment available on version: ru


Department of Care
OneBox production wrote:

Viktor Viktorovych Mazur
SheBo wrote:
soooo i forgot, thanks! I don't know what came over me :D
good mood:)

mutually
{|$dynx_itemid|}
{|$dynx_pagetype|}
{|$dynx_totalvalue|}
[[arg_xxx]] - where xx is any value of the argument from the page
{|$orderId|} - on the page after creating the order
{|$productcount|} - ibid.
like everything +-. On the product page, you can still put all the grids into the product block, but there you need to print the internal variables separately directly live, you saved the ones you need

yes it works thanks to the Care Department (thanks Dimon)!
02.10.2023, 15:25
Original comment available on version: ua

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment