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

155
Visualizações
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 à 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