Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

0

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

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda