Jump to content

where to put code for 'Linked in button'


Recommended Posts

Hi

 

I have the following code for a 'Linked in button' which I want to put onto my product pages.

 

<script src="//platform.linkedin.com/in.js" type="text/javascript">

lang: fr_FR

</script>

<script type="IN/Share" data-url="http://velofrance.fr" data-counter="right"></script>

 

Can anyone tell me where to place this code so that it will put the 'Linked in box' below the product on the view product page?

 

I presume this must be a similar process for all 'social media' NOT included in the module version?

ie facebook.

 

I've been able to add 'Pinterest' using a Presto Changeo module but can't see any module option for Linked In.

 

Thanks

Poly

Link to comment
Share on other sites

thanks for clarification, so in this case open the file: themes/your_theme/product.tpl

you've got there something like:

<ul id="usefull_link_block">
  {if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if}
  <li class="print"><a href="javascript:print();">{l s='Print'}</a></li>
  {if $have_image && !$jqZoomEnabled}
  {/if}
</ul>

 

right after the:

<li class="print"><a href="javascript:print();">{l s='Print'}</a></li>

 

you can add own code.

 

 

my another question: code that you mentioned above is only javascript, have you got any additional code from linked in ? or it is all what you've got?

Link to comment
Share on other sites

Hi

Please take a look at the following 'helpful advice info' I have regarding the LinkedIn button. BLUE text is 3rd person advice and RED is myself CAPITAL LETTERS & Vekia.

 

<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script>

<script type="IN/Share" data-counter="right"></script> THIS IS FROM LINKEDIN

 

Now you need to add an additional parameter to the code in order to trigger the Google Analytics when the user shares your content via the LinkedIn Share Button: data-onsuccess="LinkedInShare".

 

Place the resulting code:

<script type="IN/Share" data-counter="right" data-onsuccess="LinkedInShare"></script>

within the <body> ... </body> tags of your file, where you want the LinkedIn Share Button to appear.

 

thanks for clarification, so in this case open the file: themes/your_theme/product.tpl you've got there something like:

 

<ul id="usefull_link_block"> {if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if} <li class="print"><a href="javascript:print();">{l s='Print'}</a></li> {if $have_image && !$jqZoomEnabled} {/if} </ul>

right after the: <li class="print"><a href="javascript:print();">{l s='Print'}</a></li> you can add own code.

 

Add JavaScript to your file to make it work

Now you’ll see the purpose of the data-onsuccess="LinkedInShare" you added to the provided Share Button code.

 

The following JavaScript — the “LinkedInShare” function — should be placed within the <head> tag of your file, preferably after the JavaScript that calls the Google Analytics JavaScript (ga_social_tracking.js):WHERE IS THIS?

<!-- Google Analytics Social Button Tracking -->

<script type="text/javascript" src="/js/ga_social_tracking.js"></script>

 

<!-- LinkedIn Share Button tracking-->

<script type="text/javascript">

function LinkedInShare() {

_gaq.push(['_trackSocial', 'LinkedIn', 'Share']);

}

</script>

 

2 Questions please:-

Is this code correct?

Can someone with more knowledge & experience please be kind enough to complie it into a 'completed block' so that I can review it with WC3 and try to learn from it, before I post it into my site.

 

I can't thank you enough for taking the trouble to help out an amateur!

Poly

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...