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    

Share Tracking

Share Tracking Snippet

If you want to track shares of short codes from your own system, you may use the following snippet.

Note that it requires the variable "campaign_link" to be set to the short url being shared. Use the reference table to determine how to set the variable "service".

Also note that any shares from our system (Ecomm Widget, Refer-a-Friend widget, addThis snippet, and profiles) are automatically tracked by us.

Parameters for variable "service":

Twitter

twitter

Facebook

facebook

Email

email

SMS

sms

Google+

google_plusone_share

Linkedin

linkedin

Pinterest

pinterest

Tumblr

tumblr

StumbleUpon

stumbleupon

Blogger

blogger

Digg

digg

Evernote

evernote

Friendfeed

friendfeed

Myspace

myspace

Reddit

reddit

Tweetmeme

tweetmeme

Yahoo

yahoo

<script type="text/javascript">
        function mbsy_share(service, campaign_link)
        {
            var xmlhttp;
            if(window.XMLHttpRequest)
            {
                xmlhttp=new XMLHttpRequest();
            }else{
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            var url_fragments = campaign_link.split("/");
            var short_code = url_fragments[url_fragments.length-1];

            xmlhttp.open("GET","https://getambassador.com/share_tracker/track_share?short_code="+short_code+"&social_name="+service+"",true);
            xmlhttp.send();
        }
    </script>