Inserting Javascript code around input field value in PHP template

I’m working on a database of people on a WordPress site usin this plugin.
I want the LinkedIn Member Profile Plugin to display for each person in the database, but the user should only have to enter his/her own LinkedIn-URL and not all of the js code, which is:

<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/MemberProfile" data-id="LINKEDIN_PROFILE_URL" data-format="inline" data-related="false"></script>

I created a custom PHP template to achieve this, but it doesn’t display as expected. What I have now is:

Read More
  if($this->field->name === 'linkedin_badge') : ?>
                             <script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/MemberProfile" data-id="<?php echo $this->field->print_value() ?>" data-format="inline" data-related="false"></script>
                    <?php else : ?> 
                    <?php endif;  

where the field ‘linkedin_badge’ is where I ask users to type their LinkedIn-URL, but it only displays a small LinkedIn icon and not the larger LinkedIn-badge.

What am I doing wrong?

Related posts