Skip to main content
Solved

Request without error, no data in metrics


Hello, I need help with events.

I sent some events with "Ordered Product" and "Placed Order", but not even one of them is visible in Klaviyo Panel. I already tried to change field types (string, integer, float). If I sent wrong request I had error messages, but now response is empty. If you need logs, I can send them later.

Regards,
Peter

12 replies

Userlevel 5
Badge +26

Hello @PeterZ97 

Do you see these events in the customer profile?

Badge +1

Hey @Maxbuzz

Sadly I can’t see them in profiles.

In metrics, in API filter I see them:

But “Ordered Product” and “Placed Order” are empty.

In profile I can only see other 4 metrics - “Active on Site”, “Added to Cart”, “Started Checkout” and “Viewed Product” and they are filled with data.

I already checked structure, requests, responses. I compared my requests to new Klaviyo version and don’t see any differences.

If it can help - I have free / trial version of Klaviyo. Maybe this version has limits.

 

Regards,

Peter.

 

Userlevel 5
Badge +26

Hello @PeterZ97 

Open Metrics under any profile and click on Edit Metrics button.
 



There you will have option to select the metrics, once selected then click on Choose a metric and  click on Update Metrics button.

The selected metric will appear in the profile.

Badge +1

@Maxbuzz 

Hey, thanks for your answers, but I think it’s other type of problem.

I added metrics in profile, but I still need to get backend data from my application and put it into Klaviyo. As you can see my “Ordered Product” and “Placed Order” values equals 0, but in my app logs I don’t have any errors, only empty response.

 

Regards,

Peter.

Userlevel 5
Badge +30

@PeterZ97 Which integration is the order data coming from?

Badge +1

Hello @kaila.lawrence 

It’s custom integration, I tried to change requests but nothing happened. Klaviyo always returns empty response, without any error code, error message, anything. If I don’t see any errors I can’t debug application and adjust it to current API version.

Please, I need to finish before Klaviyo disable old versions.

Userlevel 5
Badge +8

@PeterZ97, would you be able to share an example request payload — redacting any PII / private keys— you’re using here as well as the public API key for the account you’re testing with? 

We need a little more information to be able to better understand how best to help here. 

Badge +1

@Kim Strauch 

Requests and responses in PHP are below, it’s “Placed Order” and “Ordered Product”.

It’s version berfore they are parsed to JSON using json_encode($data, JSON_UNESCAPED_UNICODE);

I changed urls, emails and ids because don’t want them to be public, used curl to send requests. Private API Key is correct.

If you need all headers (with hidden key) I can also send them, but it’s only 4 lines - content type, accept, revision and api key.

2024-06-18 08:46:42 array (
'address' => 'https://a.klaviyo.com/api/events/',
'request' =>
array (
'data' =>
array (
'type' => 'event',
'attributes' =>
array (
'properties' =>
array (
'OrderId' => '361',
'Categories' =>
array (
0 => 'DLA JEŹDŹCA',
),
'ItemNames' =>
array (
0 => 'Koszulka FP JUSTINE AIRY biał-nieb',
),
'Brands' =>
array (
0 => 'FAIR PLAY',
),
'Items' =>
array (
0 =>
array (
'ProductID' => '21802',
'SKU' => '03231.biał-nieb 0503',
'ProductName' => 'Koszulka FP JUSTINE AIRY biał-nieb',
'Quantity' => 1,
'ItemPrice' => 38.560000000000002,
'RowTotal' => 38.560000000000002,
'ProductURL' => 'https://XXXXXXXXXXXXXXXXX/p/1/21802/koszulka-fp-justine-airy-bial-nieb--dla-jezdzca.html',
'ImageURL' => 'https://XXXXXXXXXXXXXXXXX/templates/images/thumb/26728/500/500/pl/0/templates/images/products/26728/738-03231-bial-nieb-0503_0.jpg',
'Categories' =>
array (
0 => 'DLA JEŹDŹCA',
),
'Brand' => 'FAIR PLAY',
),
),
'BillingAddress' =>
array (
'FirstName' => 'test',
'LastName' => 'test',
'Address1' => 'test 1',
'City' => 'test',
'CountryCode' => 'PL',
'Zip' => '00-003',
),
'ShippingAddress' =>
array (
'Address1' => 'test 1',
),
),
'time' => '2024-06-18T08:46:41+02:00',
'value' => 53.560000000000002,
'value_currency' => 'PLN',
'unique_id' => 'XXXXXXXXXXXXXXXXX',
'metric' =>
array (
'data' =>
array (
'type' => 'metric',
'attributes' =>
array (
'name' => 'Placed Order',
),
),
),
'profile' =>
array (
'data' =>
array (
'type' => 'profile',
'id' => 'XXXXXXXXXXXXXXXXX',
'attributes' =>
array (
'email' => 'XXXXXXXXXXXXXXXXX',
),
),
),
),
),
),
'response' => '',
'response status' => 202,
'error' => '',
'errno' => 0,
)

----------------------------------------------------

2024-06-18 08:46:42 array (
'address' => 'https://a.klaviyo.com/api/events/',
'request' =>
array (
'data' =>
array (
'type' => 'event',
'attributes' =>
array (
'properties' =>
array (
'OrderId' => '361',
'ProductId' => '21802',
'SKU' => '03231.biał-nieb 0503',
'ProductName' => 'Koszulka FP JUSTINE AIRY biał-nieb',
'Quantity' => 1,
'ProductURL' => 'https://XXXXXXXXXXXXXXXXX/p/1/21802/koszulka-fp-justine-airy-bial-nieb--dla-jezdzca.html',
'ImageURL' => 'https://XXXXXXXXXXXXXXXXX/templates/images/thumb/26728/500/500/pl/0/templates/images/products/26728/738-03231-bial-nieb-0503_0.jpg',
'Categories' =>
array (
0 => 'DLA JEŹDŹCA',
),
'ProductBrand' => 'FAIR PLAY',
),
'time' => '2024-06-18T08:46:42+02:00',
'value' => 38.560000000000002,
'value_currency' => 'PLN',
'unique_id' => 'XXXXXXXXXXXXXXXXX',
'metric' =>
array (
'data' =>
array (
'type' => 'metric',
'attributes' =>
array (
'name' => 'Ordered Product',
),
),
),
'profile' =>
array (
'data' =>
array (
'type' => 'profile',
'id' => 'XXXXXXXXXXXXXXXXX',
'attributes' =>
array (
'email' => 'XXXXXXXXXXXXXXXXX',
),
),
),
),
),
),
'response' => '',
'response status' => 202,
'error' => '',
'errno' => 0,
)
Userlevel 5
Badge +8

Hey @PeterZ97, can you share your 6-character public API key as well for us to dig in for a closer look? See this guide for how to find your public API key: https://help.klaviyo.com/hc/en-us/articles/115005062267 

One thing that’s hard to tell from your request payload above is whether the things marked as arrays are passed in as arrays vs. as objects. Our APIs are expecting to receive these as objects. 

 

One other thing that might be a problem here is if you’re using an invalid profile ID (profile ID is not required, but you need ≥1 profile identifier) or if the profile ID and email you’re providing are leading to a conflicting situation, causing the profile resolution to fail (e.g. if the email address provided belongs to a profile other than the one referenced by the profile ID). 

Badge +1

@Kim Strauch thanks for your answer, I will check the differences.

My public key: WigTYB

Userlevel 5
Badge +8

@PeterZ97  It appears you are using the same profile ID across many email addresses. Otherwise the syntax for your calls looks correct.

I’d recommend removing the “id” from the profile part of your payload and providing only the email address. As mentioned above, you just need a single profile identifier, so email should work for you. Hopefully that resolves the issue here!

Badge +1

@Kim Strauch

I’m very thankful for your help, now events are correct and I can see them in panel. ID in profile part was my problem.

Reply