Client SDK

Installation

First include the sdk in your website
1
<script src="https://convertedin-pixel-sdk-v1.s3.amazonaws.com/sdk.js"></script>
Copied!
Then initialize the sdk by providing the pixel key
1
<script>
2
ciq("init", "{your-pixel-key-goes-here}")
3
</script>
Copied!

Send tracking events

Event Name
Event Description
PageView
This is the default pixel tracking page visits. a person lands on your website pages.
ViewContent
A visit to a web page you care about (product details page). a person lands on a product details page.
AddToCart
When a product is added to the shopping cart. a person clicks on an add to cart button.
InitiateCheckout
When a person enters the checkout flow prior to completing the checkout flow.
Purchase
When a purchase is made or checkout flow is completed. A person has finished the purchase or checkout flow and lands on thank you or confirmation page.

Usage

1
// the basic syntax
2
ciq("track", "EventName", data={});
Copied!
1
<script>
2
// PageView
3
ciq("track", "PageView");
4
5
// ViewContent
6
ciq("track", "ViewContent", {
7
content: [
8
{
9
id: 1234, // required
10
quantity: 3, // required
11
name: "Product name", // optional
12
category: "Product Category", // optional
13
}
14
],
15
currency: "USD", // required
16
value: 150.50 // required, sum of products price
17
});
18
19
// AddToCart
20
ciq("track", "AddToCart", {
21
content: [
22
{
23
id: 1234, // required
24
quantity: 3, // required
25
name: "Product name", // optional
26
category: "Product Category", // optional
27
},
28
{
29
id: 456,
30
quantity: 1,
31
}
32
],
33
currency: "USD", // required
34
value: 150.50 // required
35
});
36
37
// InitiateCheckout
38
ciq("track", "InitiateCheckout", {
39
content: [
40
{
41
id: 1234, // required
42
quantity: 3, // required
43
name: "Product name", // optional
44
category: "Product Category", // optional
45
},
46
{
47
id: 456,
48
quantity: 1,
49
}
50
],
51
currency: "USD", // required
52
value: 150.50 // required
53
});
54
55
// Purchase
56
ciq("track", "Purchase", {
57
content: [
58
{
59
id: 1234, // required
60
quantity: 3, // required
61
name: "Product name", // optional
62
category: "Product Category", // optional
63
},
64
{
65
id: 456,
66
quantity: 1,
67
}
68
],
69
order_id: 1234343545, // required
70
currency: "USD", // required
71
value: 150.50 // required
72
});
73
</script>
Copied!

Identity

identify the customer if he authenticated by the id or email or phone to re target him in ads. the recommended way is to add all data.
1
ciq('identity', {your_store_customer_id}, {
2
phone: "" ,
3
email: "",
4
});
Copied!

Popup Identity

is a modal box that ask the user about his email and phone to re target him in email or sms campaigns, if he not authenticated user or anonymous, if the customer fill this data the popup no more appear to him.
1
// the basic syntax
2
ciq('popup', timeout, options);
Copied!
the popup already predefined with English localization simply you can call
1
// will show the popup after 1 second.
2
ciq('popup', 1000);
Copied!
if you need any customization you can use this code for any language or any custom text, for example if your localization is Arabic.
1
ciq('popup', 1000, {
2
dir: 'rtl', // or ltr
3
emailText: "البريد الإلكتروني",
4
phoneText: "رقم الهاتف",
5
headerText: "كن على اطلاع على آخر الخدمات والأسعار",
6
thanksText: "شكرا لحسن تواصلك",
7
submitText: "حفظ",
8
notValidEmail: "بريد إلكتروني غير صحيح",
9
notValidPhone: "رقم هاتف غير صحيح",
10
// set to show the popup after dismiss time
11
appearIfDismissAfter: 120 // time in seconds
12
});
Copied!
and the result will be like this
you can also use your custom popup or modal and ask the user for his email and phone or any login service and then identify him by use this code.
1
ciq('identity', null, {
2
phone: "{customer_phone}" ,
3
email: "{customer_email}",
4
});
Copied!