call to replace anchor tags contains '/admin' in href

Structured Data (Microdata)

Microdata (sometimes referred to as structured data, rich snippets, or schema code markup) is the machine-readable data that is embedded in a web page. It provides specific information which is easily interpreted by search engines and other web services.

Microdata helps automated programs to understand the content of your web page better. Browsers, search engines as well as web crawlers analyse the information on the web pages and produces relevant results for users.

Microdata includes information types such as reviews, personal information or events. Each information type has its properties.

Why is Microdata Important?

Search engines crawl microdata and present it in an easy and user-friendly format. This offers more engaging and rich browsing experience for the customers.

Microdata enhance your search result listings with information like ratings, pricing, brand and stock levels, etc. These enhancements improve both click-through and conversion rates. This help to make listings stand out, which empowers the users to make confident, informed decisions and increase traffic organically on your website. 

For example, you can include microdata in your product catelog. Products listed in search engine result pages display details like price, availability, and review rating and present the product data in easy to read format, thus encouraging the users to make a purchase.

Microdata support in StoreHippo

StoreHippo supports microdata in all its themes. The microdata widget is included in themes that contain structured data definitions for different theme pages on your store. Microdata is automatically added in the HTML code of product pages. There is no need for additional action to enable the structured data. Microdata pulls the information present on the product page.

Microdata is included in the following pages on StoreHippo:

  • Product pages
  • Categories
  • Collections
  • Reviews
  • Blog Posts

StoreHippo automatically includes microdata, but also provide you with the liberty to edit it. You can also add the microdata code in the HTML if you are using a custom theme or an old theme which doesn't support the microdata. Given below is the microdata code for you to include in your theme. You can use this snippet in the header for your website. 

function ($rootScope, $timeout,$location,$scope) {
    $(document).ready(function () {
        var element = document.getElementById("metadata_site");
        if(element) element.parentNode.removeChild(element);

        var el = document.createElement('script');
        el.type = 'application/ld+json';
        el.id = 'metadata_site',
            el.text = JSON.stringify({
                "@context": "http://schema.org",
                "@type": "WebSite",
                "url": ms.settings.online_url
            });
        document.querySelector('head').appendChild(el);
    });

    $rootScope.$on('$stateChangeStart', function (event, toState, fromState) {
        console.log("state ------ ", toState);
        if(toState.url === '/product/:product'){
            // if(false){
            console.log("scope",$scope.product);
            $timeout(function () {
                var element = document.getElementById("metadata_product");
                if(element) element.parentNode.removeChild(element);
                if ($rootScope.ms.widgets && $rootScope.ms.widgets['ms.product'] && $rootScope.ms.widgets['ms.product'].product) {
                    var product = $rootScope.ms.widgets['ms.product'].product;
                    if (product) {
                        console.log('product===',product)
                        console.log('review===',product.review)

                        var div = document.createElement("div");
                        div.innerHTML = product.description;
                        var description = div.textContent || div.innerText || "";

                        var ele = document.createElement('script');
                        ele.type = 'application/ld+json';
                        ele.id = 'metadata_product'
                        ele.text = JSON.stringify({
                            "@context": "http://schema.org",
                            "@type": "Product",
                            "name": product.name,
                            "image": product.images.length ? ms.store.baseUrl+'/'+product.images[0].image :0,
                            "description":product.description,
                            "brand": {
                                "@type": "Thing",
                                "name": "product.brand"
                            },

                            "aggregateRating": {
                                "@type": "AggregateRating",
                                "ratingCount": product.avg_rating ? product.avg_rating :0 ,
                                "ratingValue":  product.avg_rating ? product.avg_rating :0,
                           },

                            "sku": product.sku,
                            "offers": {
                                "@type": "Offer",
                                "priceCurrency": ms.user.currency ? ms.user.currency :"INR",
                                "highPrice": product.compare_price ?product.compare_price : product.price,
                                "lowPrice": product.price,
                                "price": product.price,
                                "availability": product.available ? "http://schema.org/InStock" :"http://schema.org/OutOfStock",
                            },
                            "review": [
                                {
                                    "@type": "Review",
                                    "author": "Ellie",
                                    "datePublished": "2011-04-01",
                                    "description": "The lamp burned out and now I have to replace it.",
                                    "name": "Not a happy camper",
                                    "reviewRating": {
                                        "@type": "Rating",
                                        "bestRating": "5",
                                        "ratingCount": product.avg_rating ? product.avg_rating :0 ,
                                        "ratingValue":  product.avg_rating ? product.avg_rating :0,
                                        "worstRating" :"1"
                                    }
                                },
                            ]
                        })
                        console.log('ele.text===',ele.text)
                        document.querySelector('head').appendChild(ele);
                    }
                }
            },2000)
        }
        $timeout(function () {
            var element = document.getElementById("metadata_blog");
            if(element) element.parentNode.removeChild(element);
            if ($rootScope.ms.widgets && $rootScope.ms.widgets['ms.blog_posts'] && $rootScope.ms.widgets["ms.blog_posts"].blogPosts) {
                var blog = $rootScope.ms.widgets['ms.blog_posts'].blogPosts;
                if (blog) {

                    blog.forEach(function(value){
                        var div = document.createElement("div");
                        div.innerHTML = value.content;
                        var description = div.textContent || div.innerText || "";
                        console.log('value===array',value)
                        var ele = document.createElement('script');
                        ele.type = 'application/ld+json';
                        ele.id = 'metadata_blog'
                        ele.text = JSON.stringify({
                            "@context": "http://schema.org/",
                            "@type": "BlogPosting",
                            "headline": value.title,
                            "Image": value.image,
                            "url": ms.settings.online_url,
                            "datePublished": value._created_by,
                            "dateModified": value.updated_on,
                            "description":description,

                            "author": value.author,
                            "publisher": {
                                "@type": "WebSite",
                                "name": "News & Opinion"
                            },
                        })
                        console.log('blog++new=====',ele.text)
                        document.querySelector('head').appendChild(ele);
                    })
                }
            }
        },2000)
    })
}

2019-02-01T10:28:23.493Z