Skip to content

Instantly share code, notes, and snippets.

@tisuchi
Created February 20, 2020 13:45
Show Gist options
  • Save tisuchi/761fd7bec34b01d2e8284926693bab33 to your computer and use it in GitHub Desktop.
Save tisuchi/761fd7bec34b01d2e8284926693bab33 to your computer and use it in GitHub Desktop.
A data example for tracking a metrics in klaviyo.
<?php
$data = [
'profiles' => [
[
'email' => '[email protected]',
]
]
];
<?php
$data = [
'event' => 'placed order',
'customer_properties' => [
'$email' => '[email protected]',
'$first_name' => 'Thouhedul',
'$last_name' => 'Islam',
'$phone_number' => '01310919000',
'$address1' => 'Road # 2',
'$address2' => 'Uttara',
'$city' => 'Dhaka',
'$zip' => '1230',
'$region' => 'Dhaka',
'$country' => 'Bangladesh',
],
'properties' => [
[
'$event_id' => 'product_1234',
'$value' => '12.5',
'ItemNames' => ['iPhone 11', 'MacBook Pro'],
'Discount Code' => 'ABC123',
'Discount Value' => 5,
'Items' => [
[
'ProductId' => '123r4',
'SKU' => 'ABD-234',
'ProductName' => 'iPhone 11',
'Quantity' => 1,
'ItemPrice' => 1000,
'ProductUrl' => 'http://www.example.com/path/to/product',
'Brand' => 'Apple',
],
[
'ProductId' => '123r4',
'SKU' => 'MAC-234',
'ProductName' => 'MacBook Pro',
'Quantity' => 1,
'ItemPrice' => 2300,
'ProductUrl' => 'http://www.example.com/path/to/product',
'Brand' => 'Apple',
],
],
],
'status' => 'success',
'register_status' => 'success',
'role' => 'client'
]
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment