|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
david2806 Smarty n00b
Joined: 11 Sep 2017 Posts: 1
|
Posted: Mon Sep 11, 2017 8:09 am Post subject: HOW TO: USING Smarty Vars for Google Remarketing |
|
|
Good Morning Everybody,
i have a problem. I would like to shown the $PRODUCT_ID in my google remarketing tag. No Problems with product_info page. All vars are in shown in there. PRODID, TOTALVALUE. I have issues with my site order_details / cart.
Tag:
<script type="text/javascript">
var google_tag_params = {
ecomm_pagetype: 'cart',
ecomm_prodid: "{$PRODUCTS_ID}"
ecomm_totalvalue: {$TOTAL_AMOUNT}
};
</script>
I want that both vars PRODUCTS_ID and TOTAL_AMOUNT but dont get them from smarty. How can I use this smarty vars in this tag?
Thank you so much for help. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Mon Sep 11, 2017 3:04 pm Post subject: |
|
|
Try json_encode |
|
Back to top |
|
bsmither Smarty Elite
Joined: 20 Dec 2011 Posts: 322 Location: West Coast
|
Posted: Mon Sep 11, 2017 4:33 pm Post subject: |
|
|
At the end of your order_details template, add the {debug} command. This will add diagnostic code to the HTML sent to the browser and your browser will pop up a window to show it.
Make sure you have appropriate variables that you can use.
If not, you will need to add PHP statements to your script that populates the order_details template to assign values to the variables you want to have. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|