Skip to main content

I have noticed that Klaviyo's Magento connection create personalized event names without the use of metrics

Example:

- Ordered "Watch - 34mm, Gold, Steel (SKU123)"
  Sep 11, 2024, 9:54 AM EST

- Ordered "Insurance"
  Jul 31, 2024, 4:15 AM EST

- Placed order for "$29.99"
  Jun 28, 2024, 12:59 AM EST

In the last case (placed order), I know how to do it, is adding the variable $value = 29.99 in the create event POST.

But the first two, I have not found how to name the event if not using the metric attribute name, but the way, Klaviyo adds the Magento events placing all those above in the Magento metric only, not creating new metrics.

Any idea how to name the event via API? Thanks in advance.

Mostrar menos

 

Ok I found the answer, is using the “Ordered Product” metric that are part of the default metrics for API

 

When the “Ordered Product” metric is used, the product variable “Name” is placed in the event in the way shown below.

 

I.e.JSON to Create Event Post

{    "data": {

        "type": "event",

        "attributes": {

            "properties": {

                "StoreName": "STORE01",

                "SKU": "INSURANCE",

                "Name": "Insurance",

                "Quantity": 1,

                "ItemPrice": 29.88,

                "$value": 29.88,

                "$value_currency": "USD",

            },

            "metric": {

                "data": {

                    "type": "metric",

                    "attributes": {

                        "name": "Ordered Product",

                        "service": null

                    }

                }

            },

            "profile": {

                "data": {

                    "type": "profile",

                    "attributes": {

                        "properties": {

                            "StoreName": "STORE01"

                        },

                        "phone_number": "+529993421236",

                        "external_id": "TEST4 CHURRASCO4",

                        "anonymous_id": null,

                        "_kx": null,

                        "first_name": "TEST4",

                        "last_name": "CHURRASCO4",

                        "organization": null,

                        "title": null,

                        "image": null,

                        "location": {

                            "address1": "",

                            "address2": "",

                            "city": "",

                            "country": "",

                            "latitude": null,

                            "longitude": null,

                            "region": null,

                            "zip": "",

                            "timezone": null,

                            "ip": null

                        },

                        "meta": null,

                        "email": null

                    },

                    "id": null

                }

            },

            "time": "2024-10-14T11:17:33",

            "value": 0,

            "value_currency": "USD",

            "unique_id": "00008403"

        }

    }

}

The above JSON Create Event Post shows the event as below on Klaviyo

- Ordered "Insurance"
  Jul 31, 2024, 4:15 AM EST

  StoreName: STORE01

  SKU: INSURANCE

  Name: Insurance

  Quantity: 1

  ItemPrice: 29.88

  $value_currency: USD

  $value: 29.88

 


Reply