set text to google+ share button

妖精的绣舞 提交于 2019-12-04 04:14:11

The snippet for your page is generated by a server-side fetch of your page. The page fetcher does not execute JavaScript. This is why the changes that you've made to that element are not expressed in your share.

You can work around this issue using a get parameter and by specifying a target.

  1. Configure your page to accept the description as a GET paramater. For example, http://exmaple.com?desc=foobar would cause your Open Graph tag to look something like this: <meta property="og:description" content="foobar" />
  2. When you render your share link, share button or +1 button, target the page with the desired description specified using the GET parameter. For the share button, your markup may look like this: <div class="g-plus" data-action="share" data-href="http://example.com/?desc=foobar"></div>

This will, however, impact counts. If you use this technique with the +1 button, each description will be considered a different page and the counts will accumulate separately.

I know that Facebook caches information for the description and other meta. It seems according to this link, Google + does as well. It seems like it's cached for an indefinite amount of time... This renders your situation nearly impossible, depending on how often you want to change the content. Either that, or wait a few days, and see if it does change. I'd like to note that Jenny is also correct, but after moving through that, you most likely still won't get desirable results.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!