Skip to content

Custom save button cannot pin image with description & url #103

@shelly-hsueh

Description

@shelly-hsueh

Url & description seems not being pinned by the ways documented in "Custom button conversion" of Save button

We tried both HTML & JavaScript ways, and they open the same pin-builder page:

  1. Only image shown, no url & description
  2. On the left of the image, there is a white circle which might be a delete icon
    image

This is our JavaScript code:

<script>
  function pinOneByJavascript() {
    PinUtils.pinOne({
      url: 'https://www.flickr.com/photos/192240687@N07/50970872158/in/dateposted-public/',
      media: 'https://live.staticflickr.com/65535/50970872158_5682db17cb_w.jpg',
      description: 'OG-Description: This page is for testing'
    });
  }
</script>
<button onclick="pinOneByJavascript()">Pin By Javascript</button>

HTML:

<script>
  function pinterestErrorLog(error) {
    console.error('[pinterestErrorLog]')
    console.error(error)
  }
</script>
<a href="https://www.pinterest.com/pin/create/button/"
   data-pin-do="buttonPin"
   data-pin-custom="true"
   data-pin-description="OG-Description: This page is for testing"
   data-pin-media="https://live.staticflickr.com/65535/50970872158_5682db17cb_w.jpg"
   data-pin-url="https://www.flickr.com/photos/192240687@N07/50970872158/in/dateposted-public/"
   data-pin-error="pinterestErrorLog"
>
  <button>Pin By HTML</button>
</a>

The way we used to pin image doesn't work either (same pin-builder page as mentioned):

const url = 'https://www.flickr.com/photos/192240687@N07/50970872158/in/dateposted-public/'
const media = 'https://live.staticflickr.com/65535/50970872158_5682db17cb_w.jpg'
const description = 'OG-Description: This page is for testing'

const href = `https://pinterest.com/pin/create/link/?url=${encodeURIComponent(url)}&media=${encodeURIComponent(media)}&description=${encodeURIComponent(description)}`
window.open(href, '_blank');

codepen for above code

Any help would be much appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions