fur Posted July 5, 2013 Share Posted July 5, 2013 (edited) This a light-weight add-on for Google AdWords dynamic remarketing tag. Dynamic remarketing lets you reach your past site visitors with ads that show the specific products people viewed on your site. Once you've set up your dynamic remarketing campaign, you'll need to add the dynamic remarketing tag, including custom parameters, to your site so your lists can start working. More on: https://support.google.com/adwords/answer/3103357?hl=en Download here Edited July 5, 2013 by burt removed external url Quote AdWords Dynamic Remarketing Tag - Tell Google What to Advertise [2.2.x] [2.3.x] AjaxCheckoutAddress - Change Address and Checkout in Once [2.2.x] SmartSuggest - Self-learning Ajax Search Suggestion [2.2.x] [2.3.x] More about me. Link to comment Share on other sites More sharing options...
rikic Posted July 12, 2013 Share Posted July 12, 2013 hi Richard, thank you for your contribution. I've just a little problem: I've installed SPPC on my web page and when I made a special offer the tag doesn't charge the special price but only the original price. I think that it should be very important for the remarketing campaign that the special would be shown. do you have any idea? thank you again for your help. riccardo Quote Link to comment Share on other sites More sharing options...
rikic Posted July 12, 2013 Share Posted July 12, 2013 (edited) Hi Richard, I thought I've solved the problem doing this change in FILENAME_PRODUCT_INFO, but it seems doesn't work correctly. case FILENAME_PRODUCT_INFO: global $_GET; if(tep_not_null($_GET['products_id'])){ $return[0] = "'" . $_GET['products_id'] . "'"; global $product_info; if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $product_info['specials_new_products_price'] = $new_price; } $return[2] = $product_info['specials_new_products_price'] ? $product_info['specials_new_products_price'] : $product_info['products_price']; } $return[1] = 'product'; break; do you other ideas... ? I'm not a professional coder.... :- thank you riccardo Edited July 12, 2013 by rikic fur 1 Quote Link to comment Share on other sites More sharing options...
fur Posted July 16, 2013 Author Share Posted July 16, 2013 Thanks for pointing this out riccardo, My apologize I customized products_info.php page and put $product_info['specials_new_products_price'] by my own. Your approach is correct and I cannot see anything wrong in your code... My site doesnt have SPPC installed so I can't test it esaily... My updated version work good in special price with function tep_get_products_special_price()... So... may be if you can locate and post the part of code where the special price is shown in product_info.php, that may help debugging... Quote AdWords Dynamic Remarketing Tag - Tell Google What to Advertise [2.2.x] [2.3.x] AjaxCheckoutAddress - Change Address and Checkout in Once [2.2.x] SmartSuggest - Self-learning Ajax Search Suggestion [2.2.x] [2.3.x] More about me. Link to comment Share on other sites More sharing options...
rikic Posted July 16, 2013 Share Posted July 16, 2013 Hi richard, I've tested your updated version and it works great as it is, even with SPPC installed. Great job! thank you very much! riccardo Quote Link to comment Share on other sites More sharing options...
fur Posted July 17, 2013 Author Share Posted July 17, 2013 good, my bad didnt test well before releasing it~ Quote AdWords Dynamic Remarketing Tag - Tell Google What to Advertise [2.2.x] [2.3.x] AjaxCheckoutAddress - Change Address and Checkout in Once [2.2.x] SmartSuggest - Self-learning Ajax Search Suggestion [2.2.x] [2.3.x] More about me. Link to comment Share on other sites More sharing options...
rikic Posted July 25, 2013 Share Posted July 25, 2013 Hi richard, I've tested last version of yo our contribution on my website abnd I think there's a bug: it doesn't charge the "coma" in the price. I mean, if the price is € 109,00 it shows 10900. any idea? thank you very much riccardo Quote Link to comment Share on other sites More sharing options...
fur Posted July 31, 2013 Author Share Posted July 31, 2013 thx for your reply, rikic I did that on purpose, in US dollars e.g. $1,234.56 need to be 1234.56... had no idea comma in € can be decimal point too... may work on it these few days... Quote AdWords Dynamic Remarketing Tag - Tell Google What to Advertise [2.2.x] [2.3.x] AjaxCheckoutAddress - Change Address and Checkout in Once [2.2.x] SmartSuggest - Self-learning Ajax Search Suggestion [2.2.x] [2.3.x] More about me. Link to comment Share on other sites More sharing options...
fur Posted August 1, 2013 Author Share Posted August 1, 2013 v.1.4.2 uploaded, please try and test. :D Quote AdWords Dynamic Remarketing Tag - Tell Google What to Advertise [2.2.x] [2.3.x] AjaxCheckoutAddress - Change Address and Checkout in Once [2.2.x] SmartSuggest - Self-learning Ajax Search Suggestion [2.2.x] [2.3.x] More about me. Link to comment Share on other sites More sharing options...
rikic Posted August 1, 2013 Share Posted August 1, 2013 Hi Richard, I'va just tested your last version: everything is working. Great! thank you again! :thumbsup: fur 1 Quote Link to comment Share on other sites More sharing options...
fur Posted September 3, 2013 Author Share Posted September 3, 2013 AdWords Dynamic Remarketing Tag 1.5 uploaded. Featured admin configuration and easier to install/unstall. Quote AdWords Dynamic Remarketing Tag - Tell Google What to Advertise [2.2.x] [2.3.x] AjaxCheckoutAddress - Change Address and Checkout in Once [2.2.x] SmartSuggest - Self-learning Ajax Search Suggestion [2.2.x] [2.3.x] More about me. Link to comment Share on other sites More sharing options...
JoeySchmoe Posted September 5, 2013 Share Posted September 5, 2013 Warning: call_user_func() expects parameter 1 to be a valid callback, function 'tep_uninstall_adwords_tag' not found or invalid function name in /home/XXXXXX/public_html/ADMIN-FOLDER-NAME/includes/functions/general.php on line 1302 Any thoughts? Quote Link to comment Share on other sites More sharing options...
fur Posted September 11, 2013 Author Share Posted September 11, 2013 sorry missed a function in admin general.php, please download the new version and add the function only. also tested working in 2.3.x in new version Quote AdWords Dynamic Remarketing Tag - Tell Google What to Advertise [2.2.x] [2.3.x] AjaxCheckoutAddress - Change Address and Checkout in Once [2.2.x] SmartSuggest - Self-learning Ajax Search Suggestion [2.2.x] [2.3.x] More about me. Link to comment Share on other sites More sharing options...
fur Posted December 27, 2013 Author Share Posted December 27, 2013 (edited) @@burt I couldn't edit my own thread after a curtain time.... I can only quote the thread.... Think that's the rule for normal member? Edited December 27, 2013 by fur Quote AdWords Dynamic Remarketing Tag - Tell Google What to Advertise [2.2.x] [2.3.x] AjaxCheckoutAddress - Change Address and Checkout in Once [2.2.x] SmartSuggest - Self-learning Ajax Search Suggestion [2.2.x] [2.3.x] More about me. Link to comment Share on other sites More sharing options...
♥stubbsy Posted January 23, 2014 Share Posted January 23, 2014 (edited) Hi, I have installed this and have it working ok as far as I can see from the Tag Assistant but my product values are all 0.00 as you can see <script type="text/javascript"> var google_tag_params = { ecomm_prodid: '4102', ecomm_pagetype: 'product', ecomm_totalvalue: '0.00' }; </script> My site is http://www.coastwatersports.com/ you can check any product they are all 0.00 Any idea whats up? Thanks Dave Edited January 23, 2014 by stubbsy fur 1 Quote Link to comment Share on other sites More sharing options...
fur Posted April 30, 2014 Author Share Posted April 30, 2014 Hi stubbsy, sorry for the very late reply. It seems work ok in your product page. Have you fixed it? Quote AdWords Dynamic Remarketing Tag - Tell Google What to Advertise [2.2.x] [2.3.x] AjaxCheckoutAddress - Change Address and Checkout in Once [2.2.x] SmartSuggest - Self-learning Ajax Search Suggestion [2.2.x] [2.3.x] More about me. Link to comment Share on other sites More sharing options...
Roaddoctor Posted August 26, 2016 Share Posted August 26, 2016 echo 'ecomm_totalvalue: \'' . $this->page_totalvalue . '\'' . "\n"; This line is giving me issues... First the current Google spec call for a numeric entry with no quotes. I tried changing to echo 'ecomm_totalvalue: ' . $this->page_totalvalue . '' . "\n"; which works on product pages that have a price, but gives an error on all other pages that do not have a product (null entries), with error "Tag Paramater object could not be parsed." So the original line works ok on non product pages but not well on product pages. The revised line works ok on product pages, but not on other pages What do do? Any help appreciated. The code is brief, so here is the whole file: adwords_tag.php (remarketing tag) class adwords_tag { /** * $page_totalvalue is the current page type * @var object */ var $page_type; /** * $page_totalvalue is the current page products ids * @var object */ var $page_products_id; /** * $page_totalvalue is the current page products total value * @var object */ var $page_totalvalue; /** * $installer is the installer object * @var object */ var $installer; function adwords_tag() { $this->installer = new adwords_tag_install; $scriptname = ltrim(basename($_SERVER['SCRIPT_NAME'])); $return = array(); switch($scriptname){ case FILENAME_DEFAULT: global $category_depth; if($category_depth == 'top') $this->page_type = 'home'; else $this->page_type = 'category'; $this->page_products_id = "''"; break; case FILENAME_PRODUCT_INFO: global $_GET, $currency, $currencies; if(tep_not_null($_GET['products_id'])){ $this->page_products_id = "'" . $_GET['products_id'] . "'"; global $product_info; $rate = $currencies->currencies[$currency]['value']; $decimal_places = $currencies->currencies[$currency]['decimal_places']; $this->page_totalvalue = number_format(tep_add_tax($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) * $rate, $decimal_places); if($new_price = tep_get_products_special_price($product_info['products_id'])) $this->page_totalvalue = number_format(tep_add_tax($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])), $decimal_places); }else{ $this->page_products_id = "''"; } $this->page_type = 'product'; break; case FILENAME_SHOPPING_CART: global $cart, $currency, $currencies; if($cart && is_object($cart)){ $products_id_list = array(); foreach($cart->contents as $products_id => $products_content) $products_id_list[] = "'" . (int)$products_id . "'"; if(count($products_id_list) <= 0) $this->page_products_id = "''"; elseif(count($products_id_list) == 1) $this->page_products_id = $products_id_list[0]; else $this->page_products_id = '[' . implode(',', $products_id_list) . ']'; $rate = $currencies->currencies[$currency]['value']; $decimal_places = $currencies->currencies[$currency]['decimal_places']; $this->page_totalvalue = number_format($cart->show_total() * $rate, $decimal_places); }else{ $this->page_products_id = "''"; } $this->page_type = 'cart'; break; case FILENAME_CHECKOUT_SHIPPING: case FILENAME_CHECKOUT_PAYMENT: case FILENAME_CHECKOUT_CONFIRMATION: case FILENAME_CHECKOUT_SUCCESS: global $order, $currency, $currencies; if($order && is_object($order)){ $products_id_list = array(); foreach($order->products as $product) $products_id_list[] = "'" . (int)$product['id'] . "'"; if(count($products_id_list) <= 0) $this->page_products_id = "''"; elseif(count($products_id_list) == 1) $this->page_products_id = $products_id_list[0]; else $this->page_products_id = '[' . implode(',', $products_id_list) . ']'; $rate = $currencies->currencies[$currency]['value']; $decimal_places = $currencies->currencies[$currency]['decimal_places']; if($scriptname == FILENAME_CHECKOUT_SHIPPING || $scriptname == FILENAME_CHECKOUT_PAYMENT){ // calculate the shipping tax if($scriptname == FILENAME_CHECKOUT_PAYMENT){ require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping; } $module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_')); $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $order->info['total'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); } $this->page_totalvalue = number_format($order->info['total'] * $rate, $decimal_places); }else{ $this->page_products_id = "''"; } $this->page_type = 'purchase'; break; case FILENAME_ADVANCED_SEARCH_RESULT: $this->page_products_id = "''"; $this->page_type = 'searchresults'; break; default: $this->page_products_id = "''"; $this->page_type = 'other'; } } function output() { echo '<script type="text/javascript">' . "\n"; echo 'var google_tag_params = {' . "\n"; echo 'ecomm_prodid: ' . $this->page_products_id . ',' . "\n"; echo 'ecomm_pagetype: \'' . $this->page_type . '\',' . "\n"; // echo 'ecomm_totalvalue: \'' . $this->page_totalvalue . '\'' . "\n"; echo 'ecomm_totalvalue: ' . $this->page_totalvalue . '' . "\n"; echo '};' . "\n"; echo '</script>' . "\n"; echo '<script type="text/javascript">' . "\n"; echo '/* <![CDATA[ */' . "\n"; echo 'var google_conversion_id = ' . ADWORDS_TAG_GOOGLE_CONVERSION_ID . ';' . "\n"; if (tep_not_null(ADWORDS_TAG_GOOGLE_CONVERSION_LABEL)) echo 'var google_conversion_label = "' . ADWORDS_TAG_GOOGLE_CONVERSION_LABEL . '";' . "\n"; echo 'var google_custom_params = window.google_tag_params;' . "\n"; echo 'var google_remarketing_only = true;' . "\n"; echo '/* ]]> */' . "\n"; echo '</script>' . "\n"; echo '<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">' . "\n"; echo '</script>' . "\n"; echo '<noscript>' . "\n"; echo '<div style="display:inline;">' . "\n"; echo '<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/' . ADWORDS_TAG_GOOGLE_CONVERSION_ID . '/?value=0&' . (tep_not_null(ADWORDS_TAG_GOOGLE_CONVERSION_LABEL) ? 'label=' . ADWORDS_TAG_GOOGLE_CONVERSION_LABEL . '&' : '') . 'guid=ON&script=0"/>' . "\n"; echo '</div>' . "\n"; echo '</noscript>' . "\n"; } } Quote -Dave Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted August 26, 2016 Share Posted August 26, 2016 easiest I think is to initialize the value to 0 in the 'var' declaration in the beginning of the file. var $page_totalvalue = 0; it is kinda dirty, possibly you should not have that line when you have null values, but forcing it to be 0 will likely get rid of the error for you. Quote KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
♥kymation Posted August 27, 2016 Share Posted August 27, 2016 @@Roaddoctor You can just test the value and change the output to suit: if( empty( $this->page_totalvalue ) { echo 'ecomm_totalvalue: \'\'' . "\n"; // No use including the variable if it's empty (null) } else { echo 'ecomm_totalvalue: ' . $this->page_totalvalue . "\n"; } Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Roaddoctor Posted August 27, 2016 Share Posted August 27, 2016 @@kymation @@bruyndoncx I went with this for now - seems to be OK. Thank you for the help! // echo 'ecomm_totalvalue: \'' . $this->page_totalvalue . '\'' . "\n"; // default // Fix if( empty( $this->page_totalvalue ) ) { echo 'ecomm_totalvalue: ' . '0' . '' . "\n"; // No use including the variable if it's empty (null) } else { echo 'ecomm_totalvalue: ' . $this->page_totalvalue . '' . "\n"; } // end fix Quote -Dave Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted August 27, 2016 Share Posted August 27, 2016 @@kymation @@bruyndoncx I went with this for now - seems to be OK. Thank you for the help! // echo 'ecomm_totalvalue: \'' . $this->page_totalvalue . '\'' . "\n"; // default // Fix if( empty( $this->page_totalvalue ) ) { echo 'ecomm_totalvalue: ' . '0' . '' . "\n"; // No use including the variable if it's empty (null) } else { echo 'ecomm_totalvalue: ' . $this->page_totalvalue . '' . "\n"; } // end fix Sorry to say, but my addition of the initialization of the variable to 0 logically does the same and I think is much cleaner code. Quote KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
Peper Posted August 28, 2016 Share Posted August 28, 2016 Tag inspector giving error correct tag and remove , for thousands seperator // echo 'ecomm_totalvalue: \'' . $this->page_totalvalue . '\'' . "\n"; // default // Fix echo 'ecomm_totalvalue: ' . '0' . '' . "\n"; // No use including the variable if it's empty (null) } else { echo 'ecomm_totalvalue: \'' . str_replace(",","",$this->page_totalvalue) . '\'' . "\n"; } // end fix Quote Getting the Phoenix off the ground Link to comment Share on other sites More sharing options...
Rachael w. Posted May 22, 2017 Share Posted May 22, 2017 I've tried the fixes mentioned here and I still can't get rid of the error: Number field should not be quoted: 'ecomm_totalvalue' When I try either of the fixes the page shows no tags. With the original code it's just the error. Anyone still working on this? Quote Link to comment Share on other sites More sharing options...
Peper Posted July 15, 2019 Share Posted July 15, 2019 I see Google tag changed Global tag in header: <!-- Global site tag (gtag.js) - Google Ads: your tag number --> <script async src="https://www.googletagmanager.com/gtag/js?id=AW-your tag number"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-your tag number'); </script> and also to add recommended event snippet: <script> gtag('event', 'page_view', { 'send_to': 'AW-your tag number', 'value': 'replace with value', 'items': [{ 'id': 'replace with value', 'google_business_vertical': 'retail' }] }); </script> Anyone done an update on this? Quote Getting the Phoenix off the ground Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.