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

148
Vistas
Send Stock Status Events to Google Analytics from Shopify

I'm trying to send stock status events onto Google Analytics to measure how many out of stock items are being viewed compared to in stock products.

Here is the snippet of liquid

<!--Stock Status event Sender -->

{% if product.selected_variant.available == true %}
  <script>ga('send', 'event', { eventCategory: 'Stock Status', eventAction: 'In Stock Product View'});</script>
{% else %}
<script>ga('send', 'event', { eventCategory: 'Stock Status', eventAction: 'Out of Stock Product View'});</script>
{% endif %}
<!-- End of Stock Status event Sender -->

All results are returning as 'Out of Stock Product View'

Questions:

Is the above correct?

How to I get it to fire the script again if a user selects another variant on the page? A URL parameter gets added e.g ?variant=40014584709205 - Does this count as new page firing?

Looking at current behaviour in GA - it seems to be recording the first event on product view in a session but not again when user browses another product.

about 4 years ago · Santiago Gelvez
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