Hi there, what’s the best method of inserting the LinkedIn Insight Tag into the themes function.php file.
Linkedin say this “Add the JavaScript code to every page on your domain, preferably right before the end of the tag in the global footer.”
I asked a similar question recently regarding inserting another script for Ontraport. I have literally taken the same code, which you provided in your response, and removed any mention of ‘ontraport’ and instead inserted the LinkedIn script. I have therefore done this:
// Add Linkedin insight tag to every page
// =============================================================================
add_action( 'wp_footer', 'linkedin_script', 999 );
function linkedin_script() { ?>
I ADDED THE LINKEDIN SCRIPT HERE
<?php
}
// =============================================================================
Is this a suitable method?
So for example this bit of code ‘add_action( ‘wp_footer’, ‘linkedin_script’, 999 );’
I don’t even know what the ‘999’ bit of code means but I literally copy and pasted from the previous response. Same goes for the bit of code where it says ‘linkedin_script’ I literally just wrote ‘linkedin’ where as before (from my previous question) it said ‘ontraport_script’.
Is this all fine?
Thanks
Lewis