Skip to main content
Solved

trackViewedItem does not populate a product feed

  • January 17, 2024
  • 4 replies
  • 183 views

Forum|alt.badge.img+3

I’m trying to integrate Klaviyo with a custom built website. For Viewed Product, I’m trying to follow this guide https://developers.klaviyo.com/en/docs/guide_to_integrating_a_platform_without_a_pre_built_klaviyo_integration and also included trackViewedItem as the guide stated “Calling the Klaviyo object's trackViewedItem function below will populate a product feed of recently viewed products that can be included in emails.” However, even though viewed product event worked and also sync recently viewed products into user profile, there was no product feed creation for me to use in email template. This is what a profile look like with recently viewed products display but there is no product feed for me to use: 


Here this a part of my code on Google Tag Manager for Viewed Product:
var item = {
     "ProductName": HaravanAnalytics.meta.product.title,
     "ProductID": HaravanAnalytics.meta.product.selected_or_first_available_variant.id,
     "Price": price,
     "PriceNumber": priceNumber,
     "OldPrice": oldPrice,
     "OldPriceNumber": oldPriceNumber,
     "ImageURL": HaravanAnalytics.meta.product.imageUrl,
     "URL": window.location.href,
   };

   klaviyo.push(["track", "Viewed Product", item]);
    
   klaviyo.push(["trackViewedItem", {
     "Title": item.ProductName,
     "ItemId": item.ProductID,
     "ImageUrl": item.ImageURL,
     "Url": item.URL,
     "Metadata": {
       "Price": item.Price,
       "oldPrice": item.oldPrice
     }
   }]);

Best answer by Brian Turcotte

Hi @alvin.nguyen!

My apologies for the delay here - you are correct, that snippet should automatically create a product feed, but you also then have to configure it according to these instructions:

 

- Brian

4 replies

Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • January 18, 2024

Hi @alvin.nguyen!

I’m going to check on this internally and I’ll update the thread ASAP!

Best,

Brian


Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • January 23, 2024

Hi @alvin.nguyen!

Would you be able to share a screenshot of the email template editor where the feed is missing?

Best,

Brian


Forum|alt.badge.img+3
  • Author
  • Contributor I
  • 3 replies
  • January 24, 2024

Hi @alvin.nguyen!

Would you be able to share a screenshot of the email template editor where the feed is missing?

Best,

Brian

Hi Brian,

I want to ask if I have to import/connect product feed first if I want to use recently viewed item section in user profile as a feed, or that code snippet alone would create a product feed with recently viewed item for me.

 

As right now, I don’t have a product feed in Klaviyo yet and I’m assuming the trackViewedItem snippet from here https://developers.klaviyo.com/en/docs/guide_to_integrating_a_platform_without_a_pre_built_klaviyo_integration would automatically create a product feed with recently viewed item for me. Correct me if I’m wrong.

 

Thanks


Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • April 25, 2024

Hi @alvin.nguyen!

My apologies for the delay here - you are correct, that snippet should automatically create a product feed, but you also then have to configure it according to these instructions:

 

- Brian