• Resolved wherefoodtakesus

    (@wherefoodtakesus)


    I just started using AddtoAny and when I test the Pinterest button I get the following error: Sorry, this image is broken. Please pick a different image.

    I did add the following JavaScript:

    a2a_config.callbacks.push({
        share: function(data) {
            // Get the main product's image if present on the page
            var image = document.querySelector('.pin-image img');
            
            // If sharing to Pinterest and a product image is present
            if ('Pinterest' === data.service && image && image.src) {
                // Set the shared image to the product image
                return {
                    media: image.src
                };
            }
        }
    });

    Other social share buttons are able to use the images from the page without issue.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author micropat

    (@micropat)

    Your code is working perfectly and AddToAny is appropriately routing to Pinterest where the image displays just fine, but Pinterest balks when actually saving the image.

    My guess is that Pinterest is respecting the page’s current noindex:

    <meta name='robots' content='noindex, nofollow' />

    And robots.txt:

    User-agent: *
    Disallow: /

    Try it in production with crawlers allowed, and if Pinterest still sees the image as “broken” you should try posting in Pinterest’s developer forum for help troubleshooting their issue.

Viewing 1 replies (of 1 total)
  • The topic ‘Pinterest Image Error’ is closed to new replies.