Rank Math settings are breaking Facebook Stores Sync!

#329331
  • I am very satisfied with your Rank Math service.
    But I need your help with one thing. Ranh Math is somehow blocking my feed posting products to my facebook store.

    When I try to send products with facebook pixel, “id” and “price” tags are missing in micro data tags; I’m seeing a warning from the tag check result.
    As a result, there is no product synchronization between my woocommerce and facebook stores. this is a technical error and i think it has to do with “rank math open graph settings”.
    I don’t know how to update the settings. please help.

    I was able to submit my products with a workaround, uploading a manual xml feed yesterday. But I still don’t think it works well. but i am trying to understand which setting in rank math affects my facebook pixel. please help me.

    I also contacted woocommere support team and I am forwarding their reply to you.
    https://ibb.co/Vx9JxTh
    https://ibb.co/3vp7NLT

Viewing 14 replies - 1 through 14 (of 14 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    You can use the filter given below in your active theme’s functions.php file:

    add_action( 'rank_math/head', function() {
        if ( ! is_product() ) {
            return;
        }
        global $post;
        echo '<meta property="product:retailer_item_id" content="' . $post->ID . '" />';
    }, 99 );

    This should print an ID of the product in the metadata and Facebook should be able to see it correctly.

    For the price, Rank Math automatically adds a price OpenGraph tag to the products. Can you please confirm if you are using variable products?

    Looking forward to helping you.

    Thank you.

    https://ibb.co/pwnyKSM

    I added the code you sent me to my site codes (functions.php). I am sending the image as a link. Yes, all of my products are variation products.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    The variable products have also variable prices and as such we don’t include the meta tag for the price because we can’t randomly select one out of the variations.

    This is the default behavior for variable products, exactly because of the situation explained above where there’s not one single price for the product.

    Hope this helps clarify your doubts.

    Don’t hesitate to get in touch if you have any other questions.

    Can’t choose the price of the product with variation in the photo, the lowest priced product I showed on the product listing page? or on the product detail page; Can’t choose the base price before customization?

    I want to use Rank Math. If I can’t find a solution to a plugin that’s preventing me from trading, I’ll have to stop using it. Therefore, I request you to suggest a solution to solve this situation.

    https://ibb.co/JdvCJKn
    https://ibb.co/N2SyZ1x

    Hello,

    Although not recommended you can add the following filter to add the price to the variable products:

    
    add_action( 'rank_math/head', function() {
        if ( ! is_product() ) {
            return;
        }
    
        $product = wc_get_product( get_the_ID() );
        if ( $product->is_type( 'variable' ) ) {
            echo '<meta property="product:price" content="' . $product->get_variation_price() . '" />';
        }
    }, 99 );
    

    Don’t hesitate to get in touch if you have any other questions.

    Include functions.php code as Reinelle suggested 5 days ago

    $product = wc_get_product( get_the_ID() );
    if ( $product->is_type( ‘variable’ ) ) {

    Is it enough for me to include the section?

    Or do I need to include the entire code you posted?

    Hello,

    You can use the filter code my colleague provided here as this aims towards creating required meta tags prices for variations.

    Let us know how that goes from your end.

    Please do not hesitate to let us know if you need our assistance with anything else.

    I understood that the code would be added. into the previously added code

    $product = wc_get_product( get_the_ID() );
    if ( $product->is_type( ‘variable’ ) ) {

    I was wondering if I should add these lines?

    I have forwarded the entire code that Reinelle has posted.

    I’ve included the entire code that Miguel posted.

    As in the attached image.
    https://ibb.co/B3KnbXD

    Hello,

    You should only include the code that we shared last which is the one mentioned here: https://support.rankmath.com/ticket/rank-math-settings-are-breaking-facebook-stores-sync/?view=all#post-332267

    Remove any other calls to this filter on your website.

    Thank you.

    Hi, I extracted the code that Reinelle provided. Currently, there is only the code Miguel forwarded to me in functions.php. I saved the page.

    You can see it in the attached image.
    https://ibb.co/N6mFj53

    What should I do now?

    Hello,

    The metadata on your website for the variable products already includes the price from the lowest variation so everything is set up as you asked.

    There’s nothing more to do on the website related to this situation.

    Don’t hesitate to get in touch if you have any other questions.

    Thank you very much for your support. I will monitor my site status after the changes.

    Hello,

    We are glad that we could address your concern.

    Please do let us know how that goes. We are here to help you.

    In the meantime, please don’t hesitate to let us know if you need our assistance with anything else.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 14 replies - 1 through 14 (of 14 total)

The ticket ‘Rank Math settings are breaking Facebook Stores Sync!’ is closed to new replies.