Schema for products with no GTIN, MPN, or brand

  • Hello,
    thank you for this great SEO plugin.

    I have an issue in Search Console: No global identifier provided (e.g., gtin, mpn, isbn)

    I could use Product GTIN (EAN, UPC, ISBN) for WooCommerce plugin. However I even sell customized products what do not have any GTIN, EAN or UPC.

    I these cases Google asks: If your product is new (which you submit through the condition attribute) and it doesn’t have assigned product identifiers (GTIN,…) that meet the requirements below, then submit identifier_exists with a value of no or false.

    Here is a link https://support.google.com/merchants/answer/6324478?hl=en

    Is there any chance how to get <g:identifier_exists>no</g:identifier_exists> for the products without any GTIN?

    Thank you in advance.

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

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I have created a little code for you that you can add at the end of your functions.php file in your current theme to enable it, although it is not using any Rank Math functions since it can be achieved using only usual WordPress filters:

    /* This snippet adds the g:identifier_exists tag in the header */
    add_action('wp_head', 'add_identifier_exists_tag');
    function add_identifier_exists_tag(){
    ?>
    <g:identifier_exists>no</g:identifier_exists>
    <?php
    };

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hi Alberto,
    thank you so much for your answer.

    I am trying to put your code into functions.php however am not sure about that. I see “no” on the top of my website http://www.smallpartsorganizer.com Also the same issue in Search Console is still remaining: No global identifier provided (e.g., gtin, mpn, isbn)
    Please check it out. I am not a proffesional coder so maybe I put the code wrong 🙂

    I even have products with GTIN and a BRAND. For them it’s not permitted identifier_exists=no.

    I tried “Product GTIN (EAN, UPC, ISBN) for WooCommerce” plugin but it seems that it does not provide GTIN feed for google. For example this product has EAN provided but google can’n find it:
    https://www.smallpartsorganizer.com/stackable-storage-bins/bolt-bin/

    Thank you for your kind help.
    Ivan

    Hello,

    The code I sent you is just adding the meta tag you wanted, after checking now the documentation, it seems it must be added only on Google Shopping so that is the reason it is not working for you (so you can remove it from your functions.php file).

    Since you have the plugin “Product GTIN (EAN, UPC, ISBN)” installed, could you try adding this other code in your functions.php file:

    /**
    * Filter to add GTIN to Variable Products.
    *
    * @param array $entity Snippet Data
    * @return array
    */
    add_filter( ‘rank_math/snippet/rich_snippet_product_entity’, function( $entity ) {
       if(is_product()){
         $product = new WC_Product( get_the_ID() );
         if( $product->is_type( ‘simple’ ) ){
           $gtin_value = get_post_meta($product->get_id(),’_wpm_gtin_code’, true);
           $entity[‘gtin8’] = $gtin_value;
         }elseif($product->is_type( ‘variable’ )){
           $variation = new WC_Product_Variation(get_the_ID());
           $gtin_value = get_post_meta($variation->get_id(),’_wpm_gtin_code’, true);
           $entity[‘gtin8’] = $gtin_value;
         }
       }
       
       return $entity;
    });

    Looking forward to help you.

    It is still the same issue – No global identifier provided (e.g., gtin, mpn, isbn).
    I believe the problem could be with “Product GTIN (EAN, UPC, ISBN) for WooCommerce” plugin or maybe my theme. Although EAN is submitted in the product I can not find it in the page source:
    https://www.smallpartsorganizer.com/stackable-storage-bins/bolt-bin/

    Hello,

    Please note that it is just a warning and can be ignored.

    Rank Math doesn’t have an option to add GTIN but we might add the option in the future.

    Hope that helps.

    I used this code and it looks that Google accepted the feed finally. However:
    1- GTIN is not taken from Variable products, it’s feeded from Simple products only
    2- I have some customized products without any GTIN. For such products I need to apply identifier_exists=NO function

    /**
    * Filter to add GTIN to Variable Products.
    *
    * @param array $entity Snippet Data
    * @return array
    */
    add_filter( ‘rank_math/snippet/rich_snippet_product_entity’, function( $entity ) {
    $product = new WC_Product( get_the_ID() );
    if( $product->is_type( ‘simple’ ) ){
    $gtin_value = get_post_meta($product->get_id(),’_wpm_gtin_code’, true);
    $entity[‘gtin8’] = $gtin_value;
    return $entity;
    }elseif($product->is_type( ‘variable’ )){
    $variation = new WC_Product_Variation(get_the_ID());
    $gtin_value = get_post_meta($variation->get_id(),’_wpm_gtin_code’, true);
    $entity[‘gtin8’] = $gtin_value;
    return $entity;
    }else{
    return $entity;
    }

    });

    Hello,

    About the identifier_exists=NO, you will need to add it in the Google Shopping data feed, not in the page source code, since that identified works only there.

    Looking forward to help you.

    Hi Alberto,
    can you please just advise me how to get GTIN from Variable products to schema.org?
    As I mentioned above after installation of “Product GTIN (EAN, UPC, ISBN) for WooCommerce” plugin the GTINs are not taken from Variable products. So the only products with EAN would work. Thank you.
    Ivan

    Hello,

    The code provided by Alberto should work to solve the GTIN issue for variable products. Have you added this to your functions.php file. If not please do and if the issue is still appearing, please share the affected URL so we can test this from our end.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello Michael,
    I added Alberto’s code into functions.php

    In the page source I see schema “gtin8″:”99999999” however this is not a true EAN number from “Variations”. It’s coming from “Inventory -> EAN code”

    I have 12345670 EAN assigned for that product as you can see either under the “Add to Cart” button. Please check it out:
    https://www.smallpartsorganizer.com/stackable-storage-bins/bolt-bin/

    Thank you.

    Hello,

    The wrong gtin value you see in the schema is not generated by the Rank Math plugin. Looks like you have disabled the Rank Math schema on product pages? Please check the screencast I added in the Sensitive Data Section.

    The code my colleague provided will work only on the schema data generated by the Rank Math plugin.

    I hope that helps.

    Hello Pratik,
    you are absolutely right. My rank math schema was disabled. However there is no gtin provided at all right now.

    Hello,

    I think we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

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

    Thank you.

    Hello,

    The credentials provided don’t seem to work for me. Could you please test them and update so we can assist you in this issue.

    Looking forward to helping you. Thank you.

    ​​​​​​

Viewing 15 replies - 1 through 15 (of 17 total)

You must be logged in to reply to this ticket.