Announcement

Collapse
No announcement yet.

ReadyTheme Rich Snippets Code Deprecated

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • joseibarra
    replied
    Things are fine until:
    • Click "Pages" and select "PROD"
    • Click "Resource Groups" and select "footer_js"
    I see nothing how to "have the product-json-ld script selected" and no Edit Source

    I'll see if I can post a screenshot or attach an image...



    Here is the image on my OneDrive:

    https://1drv.ms/u/s!AlzCDddLSsKoghYV...tvrFz?e=LDs0Ln




    Leave a comment:


  • Matt Zimmermann
    replied
    If you have the product-json-ld script selected, you should see Edit Source as the fifth button between the trash can and Edit Attributes.

    Leave a comment:


  • joseibarra
    replied
    Not really knowing much about adding JSON-LD data I followed the steps up to step 10 then on Step 11 I do not see "Edit Source"...

    I see buttons for CSS Resources and JavaScript Resources so am I not looking in the right place?

    Leave a comment:


  • Matt Zimmermann
    replied
    Here is the boilerplate JSON-LD data which will be included in the next version of Shadows. You may need to make changes to it based on your site and how you sell your products, so this may not work 100% as cut-n-paste. These steps are designed around using JavaScript Resources. This code passes with only warnings for items like reviews and how long the price is good for which you can add if you are using.

    To add this to your site:
    1. Navigate to User Interface -> JavaScript Resources
    2. Click "Add JavaScript Resource"
    3. Enter code "product-json-ld"
    4. Select "Inline Script"
    5. Click "Edit" for the tag attributes
    6. Change the "Value" to "application/ld+json"
    7. Turn off "Global" for this resource
    8. Click "Save"
    9. Click "Pages" and select "PROD"
    10. Click "Resource Groups" and select "footer_js"
    11. Click "Edit Source" and paste in the following code:
    Code:
    <mvt:assign name="l.settings:product:stripped_descrip" value="miva_html_strip(l.settings:product:descrip, '')"/>
    {
        "@context": "http://schema.org",
        "@type": "Product",
        "name": "&mvtj:product:name;",
        "image": "&mvt:global:socialImage;",
        "description": "&mvtj:product:stripped_descrip;",
        <mvt:if expr="NOT ISNULL l.settings:product:sku">
            "sku": "&mvtj:product:sku;",
            "mpn": "&mvtj:product:sku;",
        <mvt:else>
            "sku": "&mvtj:product:code;",
            "mpn": "&mvtj:product:code;",
        </mvt:if>
        "category": "&mvtj:category:name;",
        "brand": {
            "@type": "Thing",
            <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:brand">
                "name": "&mvtj:product:customfield_values:customfields:brand;"
            <mvt:else>
                "name": "&mvtj:global:store:name;"
            </mvt:if>
        },
        "offers": {
            "@type": "Offer",
            "url": "&mvtj:product:link;",
            <mvt:if expr="NOT ISNULL l.settings:product:sku">
                "sku": "&mvtj:product:sku;",
            <mvt:else>
                "sku": "&mvtj:product:code;",
            </mvt:if>
            "name": "&mvtj:product:name;",
            "description": "&mvtj:product:stripped_descrip;",
            "seller": "&mvtj:global:store:name;",
            "itemCondition": "new",
            <mvt:if expr="l.availability_inv_level EQ 'low'">
                "availability": "http://schema.org/LimitedAvailability",
            <mvt:elseif expr="l.availability_inv_level EQ 'out'">
                "availability": "http://schema.org/OutOfStock",
            <mvt:else>
                "availability": "http://schema.org/InStock",
            </mvt:if>
            <mvt:if expr="l.settings:attributemachine:product:inv_level">
                <mvt:assign name="l.availability_inv_level" value="l.settings:attributemachine:product:inv_level"/>
                <mvt:do name="l.formatted_variant_price" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, l.settings:attributemachine:product:price )" />
                "price": "&mvtj:attributemachine:product:price;",
            <mvt:else>
                <mvt:assign name="l.availability_inv_level" value="l.settings:product:inv_level"/>
                "price": "&mvtj:product:price;",
            </mvt:if>
            "priceCurrency": "USD"
        }
    }

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    For the "If we had more time file...."

    What would really be best is a miva based tool that would go through a series of questions about your site, like "what type of products you sell", "do you have reviews", "do you have variants or attributes", "to which are prices assigned", etc and then have it spit out a correct template for the micro data with the miva based variables populated. There would still be some manual coding involved (for example, what are the review variables), but you could probably get 80-85% of the way there.

    I've seen some existing versions of this, but you have to populate the template with your own variables.

    This does however, show why Miva can't just drop in micro data (I mean, it could, but it wouldn't be optimal).

    Leave a comment:


  • lesliekirk
    replied
    Wow, these all sound like they need some great how-to written for them.

    Leave a comment:


  • ids
    replied
    Yes, the real premise of my question was to find out if I was just lucky. JS adds complexity and I am less familiar with it. Finding out the Enhanced eCommerce stuff really won't run in GTM because of the dynamic characteristics and being SMT is an important concept to know ahead of time.

    Scott

    Leave a comment:


  • alphabet
    replied
    Hey Scott, I think you had a question like this before and you got it figured out.

    There are two different elements on the page as it relates to GTM: the dataLayer object and the app script.

    Matt's snippet creates a JSON object named dataLayer. The script then pushes data into that object.

    The other element on the page as it relates to GTM is the app script which reads the dataLayer object and sends it to a Google endpoint.

    The app script is called a container that you built in Tag Manager, saved it to a container, then published the container. The container can contain many third party scripts that read the dataLayer.

    The only GTM script that a developer needs to write to the webpage is the GTM loader script which calls and writes the latest published container script.

    Leave a comment:


  • ids
    replied
    Slightly different question but related to GTM, this snippet should not be included in the GTM bucket and must reside on the page because there is SMT?

    And then following up that question, that rendered page with the rendered values needs to be "ajax'd" to render new values when there are other potential values.

    And the more complex question/conclusion, likely better to keep these "dynamic rendering scripts" out of GTM? Seems like there would be potential timing issues if part of the script were in GTM bucket and the balance is in the page template?

    Scott

    Leave a comment:


  • Matt Zimmermann
    replied
    Oh shoot, you're correct. Looks like I had my notes mislabeled, sorry about that. I do not currently have the snipped for JSON-LD ready to go, I should have it together in the next few weeks as it will be part of the next release of Shadows.

    Leave a comment:


  • alphabet
    replied
    I think there is some confusion with the snippet provided as a starting point for structured data.

    The GTM DataLayer code snippet provided has nothing to do with Structured Data JSON LD.

    That snippet is for building a DataLayer for Google Analytics Ecommerce tracking code, not Structured Data LD.

    Leave a comment:


  • eldon99
    replied
    Best answer I've heard all day! Thanks!

    Leave a comment:


  • Matt Zimmermann
    replied
    From what I can see, there is nothing wrong with leaving both on the site as other search engines will still pick up the microdata.

    Leave a comment:


  • eldon99
    replied
    Great post! Thank you for sharing this!

    Question: In switching to GTM, should we then remove the old micro-code rich snippets, or can they be left?

    I did switch things when first working on the site from data-vocabulary.org to schema.org (for once, I chose wisely).

    Leave a comment:


  • Matt Zimmermann
    replied
    As you mentioned, the microdata code for the Legacy ReadyThemes was fairly boilerplate. That being said, you should be able to take the code from Booc and, with some massaging, put it into Levels. Booc, Storyteller, and Luxe all have Schema code, although they may need updating.

    Leave a comment:

Working...
X