'Construct the URL for the "add to profile" button.
Arguments:
course_key (CourseKey): The identifier for the course.
course_name (unicode): The display name of the course.
cert_mode (str): The course mode of the user\'s certificate (e.g. "verified", "honor", "professional")
cert_url (str): The download URL for the certificate.
Keyword Arguments:
source (str): Either "o" (for onsite/UI), "e" (for emails), or "m" (for mobile)
target (str): An identifier for the occurrance of the button.'

def add_to_profile_url(self, course_key, course_name, cert_mode, cert_url, source='o', target='dashboard'):

    company_identifier = configuration_helpers.get_value('LINKEDIN_COMPANY_ID', self.company_identifier)
    params = OrderedDict([('_ed', company_identifier), ('pfCertificationName', self._cert_name(course_name, cert_mode).encode('utf-8')), ('pfCertificationUrl', cert_url), ('source', source)])
    tracking_code = self._tracking_code(course_key, cert_mode, target)
    if (tracking_code is not None):
        params['trk'] = tracking_code
    return u'http://www.linkedin.com/profile/add?{params}'.format(params=urlencode(params))
