Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

178
Visualizações
Google+ Snippet with Open Graph Protocol

I have a web page that is dynamically built and am trying to get links that are shared on Google+ to show snippets and look nice, an example snippet for article rendering and documentation can be found here:

https://developers.google.com/+/web/snippet/article-rendering

When I follow the documentation my links do not render with everything I set in google plus, they show up like this:

enter image description here

The head of my page looks like this:

<head>
<div id="replaceGoogle"></div>
</head>

In my javascript I have this to insert the open graph tags once generated:

//replace google
        var google = '<meta property="og:type" content="article" /><meta itemprop="og:headline" content="'+ data[0].name+'" /> <meta itemprop="og:description" content="View beer on Beer Portfolio" /> <meta property="og:image" content="'+ data[0].icon +'" />';
        $("#replaceGoogle").replaceWith(google);

The data is taken from json read in from an ajax call. Can I not do this dynamically?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

I think that question is similar to Generating Open Graph meta tags dynamically. The main reason of your problem is that google+ and facebook will not execute your javascript so none of them will see your dynamic og tags.

Basic solution to this problem is :

  • create unique url for each dynamic page and save dynamic params for this url into database.
  • when your user try to share pages with this unique url you will find saved dynamic params
  • create page with og tags filled with found dynamic params

Simple schema for saving og tags for dynamic generated pages

over 4 years ago · Santiago Trujillo Relatório

0

Use server side scripting (ask for details in the comments)

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda