Skip to main content
Solved

Failed to access event data in the campaign email template

  • November 19, 2024
  • 3 replies
  • 33 views

shahidIqbal
Contributor I
Forum|alt.badge.img

I am reaching out for assistance regarding my recent attempt to use event data in our email template. Unfortunately, I was unable to achieve the desired outcome. I referenced the document at this link: Klaviyo Event Data Documentation, but I believe I may have missed some important configuration steps or might not have found the right documentation.

 

Please suggest a solution or guide me on what I might be doing incorrectly? Your expertise would be greatly appreciated.

 

Thank you so much for your attention and support.

 

API Payload:

{
  "data": {
    "type": "event",
    "attributes": {
      "properties": {
        "product_1": "S00939993939",
        "product_2": "P00939993939",
        "product_3": "D00939993939",
        "product_img_1": "https://xxx.cloudfront.net/test/photo/153/test.png",
        "product_img_2": "https://xxx.cloudfront.net/test/photo/154/test.png",
        "product_img_3": "https://xxx.cloudfront.net/test/photo/155/test.png"
      },
      "metric": {
        "data": {
          "type": "metric",
          "attributes": {
            "name": "recommendation",
            "service": "new recommendation api"
          }
        }
      },
      "profile": {
        "data": {
          "type": "profile",
          "attributes": {
            "email": "test@gmail.com"
          }
        }
      }
    }
  }
}

Screenshot:

 

Email template:

 

Best answer by chloe.strange

Hi ​@shahidIqbal,

It seemed that you have created a custom event to the Klaviyo events API. Can you please confirm this? Also, it seems that your email template is not rendering the desired event information as expected. Can you please check the syntax that you have used in the template? I’ve included some resources below for guidance:

~Chloe

View original
Did this topic or the replies in the thread help you find an answer to your question?

3 replies

chloe.strange
Community Manager
Forum|alt.badge.img+41
  • Community Manager
  • 426 replies
  • Answer
  • November 26, 2024

Hi ​@shahidIqbal,

It seemed that you have created a custom event to the Klaviyo events API. Can you please confirm this? Also, it seems that your email template is not rendering the desired event information as expected. Can you please check the syntax that you have used in the template? I’ve included some resources below for guidance:

~Chloe


shahidIqbal
Contributor I
Forum|alt.badge.img
  • Author
  • Contributor I
  • 1 reply
  • November 28, 2024

Hello ​@chloe.strange ,

Thank you so much for your reply. Here are the details.

Custom Event:

 

  1. I've created a flow that triggers specific segments and calls a third-party API. Based on the information received, the API creates an event for the profile.
  2. Additionally, I've set up another flow to send emails based on the event segments.

However, I still seem to be facing an issue. I've followed all the documentation, but the event property is still showing as blank in the screenshot I’ve attached.

 

 

Regards,
Shahid


chloe.strange
Community Manager
Forum|alt.badge.img+41
  • Community Manager
  • 426 replies
  • December 24, 2024

Hi ​@shahidIqbal,

Can you confirm that your flow is triggered by the correct event and that the event meets the necessary criteria to initiate the flow?

~Chloe