i am going to try to learn Javascript to see if I can get this to work.. i miss zencart..
i am going to try to learn Javascript to see if I can get this to work.. i miss zencart..
My Multi_Site Zen Carts
http://herasonlinemarket.com
ok, I am missing zencart way more than i thought..
and so many be putting out there were over a 200 hundred page views so maybe one of you can help.
I found this from putting in Zencart and facebook pixel in the search engine
I just don't understand what I am reading..
<QUOTE.
However, if you are running a marketing campaign where you are paying money to Facebook, you definitely want to be able to track the conversion rate of your ads.
For this to happen you will need to make some changes to the Facebook code to work with Zencart.
We need to add a tracking function to the pixel code which integrates with the Zen cart database variables. We have created this below for you to use within your facebook pixel code.
if($_GET[‘main_page’] == ‘checkout_success’) {
require_once(DIR_WS_CLASSES . ‘order.php’);
$facebook_order = new order($zv_orders_id);
//var_dump($facebook_order);
?>
// Purchase
// Track purchases or checkout flow completions (ex. landing on “Thank You” or confirmation page)
fbq(‘track’, ‘Purchase’, {value: ‘‘, currency: ‘‘});
</QUOTE>
but i need the pixel to fire on view content
and here is the code from facebook
I got most of it to work
<!-- trigger event-->
<script>
fbq('track', 'ViewContent', {
value: 10.00,
currency: 'USD',
content_ids: 'products_id', --------------------.> this is not working correctly
content_type: 'product',
});
</script>
but I keep getting an error in my facebook catalog saying the content_id did not match the products_id.
so I am thinking of all the people that have viewed this post someone should know how to make it work..
thank you..
My Multi_Site Zen Carts
http://herasonlinemarket.com
ok i am back to zencart, zencart rules...
I followed these directions below I added a folder under my template folder called checkout_success, added the file tpl_footer.php
and added the facebook pixel code to the bottom of that and it didn't show up on the chrome facebook pixel helper.
and Extention on google chrome
https://www.zen-cart.com/content.php...els-to-my-site.
so I added it to the html_header.php and its fires. but the problem I have had this whole times is that the content_id that is supposed to pull the products_id need to be dynamic. (which I am understanding means not static number).. I have a few products and to put the individual products_id numbers in it it would have too many numbers.
so just put in this code just for the content_id to match the products_id
<?php echo $content_ids['products_id']; ?>
i will tell tomorrow what facebook says about it
Thank you for reading.. and have a great sleep.
and even with this trouble i am having.. zencart rocks.
My Multi_Site Zen Carts
http://herasonlinemarket.com
Do you have structured (they call it microdata on fb) installed on your site? You have to have that before it will pull data for a catalog. And you don't need the content_id. According to their docs: https://www.facebook.com/business/help/1044262445604547
Okay so mine is working.
1. You must have all of the required schema data in each product page (read the instructions)
2. You will need to install the pixel in your common/html_header.php
3. Then IF you are tracking conversions you will need to add the pixel in a new folder checkout_success/html_header.php and you will need to pull the query for the subtotal (minimum) to populate
4. Then add some items to your catalog
5. Bump up your sharing of the added and additional products, maybe even promote a few to get it to fires (weeks here)
6. Keep checking your Facebook products screen in the add products button to see when the pixel has fired enough to be used for updates
Here is an example from checkout_success/html_header.php
I am pulling the query with a helper file.... this part will be custom to your own setup with regard to schema etc and where or how it's pulled.Code:<!-- Facebook Pixel Code --> <script> !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window, document,'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', 'XXXXXXXXXXXX'); fbq('track', 'PageView'); fbq('track', 'Purchase', {currency: "USD", value: <?php echo $order_summary['order_subtotal'];?>}); </script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=XXXXXXXXXXXX&ev=PageView&noscript=1" /></noscript> <!-- End Facebook Pixel Code -->
~Melanie
PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
**I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.
Also, read here for the required tags https://developers.facebook.com/docs...microdata-tags
yes, I do .. I have the plugin zen-cart_Structured-Data-master, and facebook open graph.
My Multi_Site Zen Carts
http://herasonlinemarket.com
so what I want is to have any time an item is viewed I want it to show up on my facebook page catalog, so I can sell on facebook also. And then be able to add a shopping button on Instagram.
the pixel has worked for the most part. but I still get this error
------------------------------------------------------------------------------------------------------------------------
1 Error
These errors must be fixed.
Events
Missing content_ids or contents parameter from "ViewContent" in Naomi McClarrinon's business's Pixel
Required parameter content_ids or contents is missing from more than 20% of ViewContent events in the last day
URL
-------------------------------------------------------------------------------------------------------------------------
this is my facebook pixel right now.. and it is on the html_header.php
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'xxxxxxxxxxxxxxxxxxx2');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=xxxxxxxxxxxxxxx2&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
and the picture below shows that the products are pulling put the problem is the are showing OUT OF STOCK, and they are in stock.
so i tried to make the folder checkout success and put in the tpl_footer.php and put this code
<script>
fbq('track', 'ViewContent', {
value: 10.00,
currency: 'USD',
content_type: 'product',
<?php echo $content_ids['products_id']; ?>
});
</script>
and this on the bottom of that page.
but it doesn't fire.
so I am so confused and what I am supposed to put in the checkout success folder... I want view content, not what is bought yet.
thank you
Noppie
My Multi_Site Zen Carts
http://herasonlinemarket.com
I havein tpl_products_info_display and it works. You could have this in the footer and it should work, too. The info is passed from the metatags, you have to have the required metatags from the page I linked. Probably the easiest way is to use the structured data module https://github.com/torvista/zen-cart_Structured-Data is what I use. It has everything needed. You can test it here: https://search.google.com/structured-data/testing-toolPHP Code:
<script>
fbq('track', 'ViewContent');
</script>
Last edited by lankeeyankee; 2 Aug 2019 at 05:20 AM.
My Multi_Site Zen Carts
http://herasonlinemarket.com
Bookmarks