Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

HOW TO: USING Smarty Vars for Google Remarketing

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
david2806
Smarty n00b


Joined: 11 Sep 2017
Posts: 1

PostPosted: Mon Sep 11, 2017 8:09 am    Post subject: HOW TO: USING Smarty Vars for Google Remarketing Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1147

PostPosted: Mon Sep 11, 2017 3:04 pm    Post subject: Reply with quote

Try json_encode
Back to top
View user's profile Send private message
bsmither
Smarty Pro


Joined: 20 Dec 2011
Posts: 134
Location: West Coast

PostPosted: Mon Sep 11, 2017 4:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP