Cohort Digital Co-Reg API
test
What is the Co-Reg API?
The Co-Reg API lets you embed the Co-Reg widget in your own web pages with JavaScript. The API provides a number of utilities for manipulating the widget so you can easily add it to your website.
What do I need?
All you need to embed the widget on your site is a unique API key that you should have received from Cohort Digital; if you don’t have one please contact us.
Table of contents (See also: Advanced API)
Adding the Cohort Digital Javascript to your site
What page should I put the widget on?
Embedding your widget
Styling your widget
General appearance
Height and width
Number of offers
Passing the widget user details
PHP
ASP
Adding the Cohort Digital Javascript to your site
In the
If you have an SSL site just change the http to https ie change src=”http:// to src=”https://
You can now embed the widget wherever you want to on the page.
What page should I put the widget on?
Co-Registration occurs on the page directly after your visitors have completed a transaction on your site. This transaction may include a purchase of some kind, registration of details for more information or inputting contact details for any other purpose.
The code should be implemented on the page of your site where visitors are taken directly after a transaction occurs.
For instance, a ‘submit’ or ‘continue’ button is usually clicked to complete a transaction. The Co-Registration process occurs directly after this final step in your transaction.
Embedding your widget
Here is an example container for the widget:
Here is the widget code to be placed before the closing tag:
You will need to specify two things to get your widget to show: the ID and the output. The ID would have been given to you by Cohort Digital and the output is the ID of the container (usually a div) where the widget will show.
Styling your widget
You can currently change the height, width and skin of the widget. These can both be easily changed in the widget code.
General appearance
The widget currently has the following skins available:
compact (default)
white (best for usability)
gradient/1col
gradient/1col/right
gradient/2col
To change from the default just change to the skin value in the widget code to the one you want. Just make sure the height of your frame can accommodate your chosen skin with the amount of offers you are serving.
Height and width
To change the height and width just specify them in px in the widget code. Eg. 400px
Number of offers
Currently you will need to contact Cohort Digital to change the amount of offers your widget will show.
Passing the widget user details
It’s easy to pass the widget the user details from your form; the following examples will show you how:
PHP
The following shows how to pass the users email to the widget using PHP POST:
Or using GET:
ASP
The following shows how to pass the users email to the widget using ASP POST:
Or using GET: