Rather than making users login to your site - you can authorize them using LinkedIn authentication (and track this data within CANDDi)

This example shows how to create a LinkedIn Application, add an authentication code to your webpage and send the data back to CANDDi.

This is based on the sample code you can find here: ((https://www.leadboxer.com/tutorials/capture-linkedin-data/))

Step 1: Get a API key from LinkedIn

Login at https://developer.linkedin.com and go the API keys overview page. You can find this under Support >> API keys. Add a New Application and fill in the form:

Company Info
Select or create a new company
Add additional administrators (optional)

Application Info
Application Name: Download button
Description: Download button for white-paper
Website URL: the website where the button will be placed
Application Use: Sales (CRM), Marketing
Application Developers: add additional developers (optional)
Live Status: Live

Contact Info
Your email
Your phone number

OAuth User Agreement
Default Scope: select r_basicprofile and r_emailaddress
Agreement Language: Browser Locale Setting

JavaScript API Domains:
Comma separated list of absolute URLs allowed for OAuth 2.0 redirections.
We strongly encourage using HTTPS.

Terms of Service
Agree: tick the box

Click ‘Add Application’ and in the next page, copy the API Key.

Step 2: Implementing the javascript snippet

<script src="/hc/admin/articles/”https:/platform.linkedin.com/in.js”" type="”text/javascript”">
   api_key: **YOUR API KEY**
   authorize: true
</script>


Step 3: Send Info To CANDDi

<script type=”text/javascript”>

function onLinkedInLoad() { 
   if (IN.User.isAuthorized()) {
   //LOG THIS INTO CANDDi as custom event
   // see: [https://support.canddi.com/hc/en-gb/articles/200269336-How-can-I-track-custom-Javascript-events](/hc/en-gb/articles/200269336-How-can-I-track-custom-Javascript-events) } else {
   window.location = “URL of page with download link“;
  }
}
</script>


Have more questions? Contact us at hello@canddi.com or 0161 414 1080
Was this article helpful?
Cancel
Thank you!