Quick Start
Keymetrik’s design goal was to be as intuitive as possible. That’s why only six items are included in the sidebar; they’re the ones most relevant for daily use.
The most important concept is to understand that Keymetrik uses Projects to manage your marketing efforts. A project is nothing else – in a rudimentary sense – than your website.
Projects
When you create your account a default project is created for you. You can change the name of this project as you wish.
To do so, open the Settings menu from the left hand side, and select Project in the tabs.
Here, you can define the default attribution type. Meaning all campaigns will use this as default setting. However you can change the attribution type for each project separately.
You also find the script snippet you need to add to your website, e.g.
<script defer src="https://cdn.keymetrik.com/script.js" data-project-id="862750e1-d034-45b5-8f79-47a189f42952"></script>
The project id is unique for you. So, don’t copy this snippet and use it on your site. Beneath it you find common API calls for adding leads, customers and purchases.
API Keys
Talking about API. You need to add a valid key. For this, open the API Keys menu from the sidebar. Here you can create your API keys.
<script defer src="https://cdn.keymetrik.com/script.js" data-project-id="862750e1-d034-45b5-8f79-47a189f42952"></script>
First, you need to create an API key for your current project. To do this, you open the API Key section in the menu.

With the button Create Key you can add an API key.

Confirm and you’ll see once the full key. Every key starts with sk_live
.

Adding Leads
When you get a lead, whether it is via signup for your newsletter, or when someone creates an account, you can send this to Keymetriks API. For this, create a payload:
const payload = {
email: "[email protected]",
firstName: "Jane",
lastName: "Doe",
};
And send it as a JSON body to our endpoint.
await fetch('https://api.keymetrik.com/lead/', {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "key",
},
body: JSON.stringify(payload),
});
If the post is successful, the lead is displayed in your dashboard immediately, with all his detail.

Adding Customers
To add a customer, this person must be first a lead. You only need the email of this lead to mark him as a customer, plus a purchase.
For this, create a payload:
const payload = {
email: "[email protected]",
purchases: [{price: 19.99}]
};
The currency itself is irrelevant. You can specify what currency you want to use in Keymetrik.
Then, send this the payload as a JSON body to our endpoint.
await fetch('https://api.keymetrik.com/customer/', {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "key",
},
body: JSON.stringify(payload),
});
And that’s it. You can of course add as many purchases to the initial customer creation as you like.
const payload = {
email: "[email protected]",
purchases: [
{price: 10.99},
{price: 19.99},
{price: 49.99},
],
};
Purchases
Now for the purchases, you only need the email of your active customer. In this case it would be [email protected].
Let’s say he buys a product worth €19,99, this is how you can add this purchase to Keymetrik
const payload = {
email: "[email protected]",
amount: 19.99,
};
await fetch('https://api.keymetrik.com/purchase/', {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "your-key",
},
body: JSON.stringify(payload),
});