URL API

URL API is a part of our JavaScript API. In order to use it, you have to install the JS library (the page must have our script installed).

API works as follows: when a visitor follows a link, he performs an event (an event by this user is tracked) and/or a property of this visitor is identified.

Event tracking

http://example.com/?cq_event=MyEvent

User performs event MyEvent by following this link.

Event tracking (with event properties)

http://example.com?cq_event=MyEvent&cq_event_param1=val1&cq_event_param2=val2

Visitor performs event MyEvent with param1 event property of val1 value and param2 event property of val2 value.

User properties identification

http://example.com/?cq_identify_$email=my@email.com

User property $email of my@email.com value will be identified for user who follows this link.

http://example.com/?cq_identify_myvalue=hello

User property myvalue of hello value will be identified for user who follows this link.

You should mind the correct url encode, “@” - forbidden symbol, thus email should look like my%40email.com.

Example

Methods can be combined. For example you’re sending a bulk email and want to see behavior of users having the link followed. You are redirecting users to http://example.com/some/page, and want all those users to perform a FromMyEmail event.

Most email services allow to use tags. For example, Mailchimp has *|URL:EMAIL|* tag allowing to insert email (URL-encoded). Which means, the link will be as follows:

http://example.com/some/page?cq_event=FromMyEmail&cq_identify_$email=*|URL:EMAIL|*

*|URL:EMAIL|* will be auto-replaced with receivers email.