Ambassador

The Ambassador Developer Hub

Welcome to the Ambassador developer hub. You'll find comprehensive guides and documentation to help you start working with Ambassador as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Cookie Fetching

Cookie "mbsy_short_code" Fetching Snippet

If you want to fetch the visitor's referring "mbsy" short code from their cookie to send to your back-end, you may include the following JavaScript snippet on your page.

NOTE: You do not need to include this snippet when using the ecommerce, form, image, or javascript integration snippets as we will fetch the visitor's referral cookie automatically.

The snippet will set the JavaScript variable "mbsy_short_code" equal to the referrer's short code (which is also passed to your landing page via the querystring).

If the visitor was not referred by anyone the variable will be set as an empty string.

<script type="text/javascript" src="https://mbsy.co/embed/v2/getcookie/[[app:username]]"></script>