Common use cases
Pixel Tracking
5min
enhance your data sets, enrich your campaigns across tools, and make clearer business decisions to track events via your website, you will need to place a javascript pixel on the pages you wish to track interactions our privacy policy and applicable terms requires you to refrain from sending us sensitive personal information about your users, including but not limited to social security numbers and credit card details how to add the pixel to your website navigate to settings > api & tracking and locate the tracking pixel code copy the entire code snippet place the code into your website header placing pixel tracking code on your website depends on the platform you're using here's some common ones wordpress go to appearance > theme editor, locate the header php file of your active theme and paste the pixel code just before the closing \<head> tag webflow go to project settings > custom code under the head code section, paste the pixel code wix navigate to settings > custom code click + add custom code paste the pixel code choose header under the placement settings set it to load on all pages (or specific ones as needed) publish your site at this point your pixel will be tracking users page views and aiq will attempt to resolve identities in your data infrastructure how to track events via the pixel to enable more complex and insightful use cases, we track events as they happen for example, you can notify aiq when a user adds to their cart, watches a product video, or starts a live chat track almost any event and segment on it later using the schema below note the following is not needed if you are only using the pixel for the popup version of the signup form navigate to settings > integrations > website js and click connect save the integration to track a custom event you can call “aiq” after the required code above anywhere on the page the example below illustrates creating and updating a customers info \<script>aiq('customeventname', 'customeventvalue');\</script> custom events event names will be available for use in your accounts audience builder after we have seen at least 1 in production commonly recognized events the following events are commonly used and therefore documented for your internal setup please note that we always track pages viewed so it is easy to segment audiences by page categories, brands viewed, products viewed, etc event description code example contact sends contact record info into personas fields are optional build your forms as you please warning warning passing mobilephone with smsoptin false , means that you want us to send that user an sms asking to confirm their optin to your loyalty program if you do not want this functionality, do not pass the phone number additionally, only send smsoptin true if you are certain a user is already part of your club and you do not want them to get the optin confirmation message \<script? aiq('contact', { email 'email\@email com', mobilephone '9708399900', firstname 'jason', lastname 'bourne' birthdate 1576274448, signedup 1576274448, agegate true, favoritestore "xyz", smsoptin false, loyalty true, addr {"city" "somerville", "state" "ma", "street" "44 green street", "country" "usa", zipcode" "02143"}, "customattributes" \[{ "key" "testkey", "value" "testvalue" }], "tosconsent" 1576274448 }); \</script> site search user searched your site \<script> aiq('sitesearch', 'the query they searched'); \</script> cart viewed user viewed your cart \<script> aiq('cartviewed','1'); \</script> product added to cart prodcut was put in a users cart \<script> aiq('productaddedtocart', { cart id '1234' product id '222', sku 'cbd 9028', category 'flower', name 'og flower', brand 'aurora', unitprice 18 99, quanitity 1, coupon '420sale', position 3, url 'https //yoursite products/path', image url 'https //yoursite com/images/ product jpg' }) ; \</script> product removed from cart product was removed from cart \<script> aiq('productremovedfromcart', { cart id '1234' product id '222', }) ; \</script> checkout started checkout flow has started \<script> aiq('checkoutstarted', '1'); \</script> checkout step viewed a new step of checkout flow has started i e "shipping info", "coupon info" etc \<script> aiq('checkoutstepviewed' ,'2'); \</script> event description code example order completed an order was completed you can pass the items in the order and other detailed information \<script> aiq('ordercompleted', { orderid 'pine12394', totalprice 27 50, totalcost 27 50, totaltax 2, discount 2 5, coupon 'giftcardcode', currency 'usd', products \[ { sku 'iq12394', name 'monopoly, 3rd edition', price 19, quantity 1, category 'flower', url 'https //yoursite com/products/path', image url 'https //yoursite com/images/ product jpg' }, ] }); \</script> email link clicked the user has arrived at current page by clicking email link \<script> aiq('emaillinkclicked', 'https //mylink com'); \</script> text link clicked the user has arrived at current page by clicking a text link \<script> aiq('textlinkclicked', 'https //mylink com'); \</script> live chat convo started live chat conversation has started \<script> aiq('livechatstarted', '1'); \</script> live chat convo ended live chat conversation has ended \<script> aiq('livechatended', '1'); \</script> live chat message sent your live chat agent has sent a message \<script> aiq('livemessagesent', 'body of message'); \</script> live chat message received your live chat agent has received a message \<script> aiq('livemessagereceived', 'body of message'); \</script> video started a video has been started by user \<script> aiq('videostarted', {name 'my video', timestamp '157627448'}); \</script> video ended a video a user has been watching has finished playing \<script> aiq('videoended', {name 'my video', timestamp '157627448'}); \</script> experiment viewed a/b testing experiment has been viewed you can use this to arrtibute performance \<script> aiq('experimentviewed', {experimentid '324', experimentname 'my experiment', variationid '123', variantname 'variation name'}); \</script>