Title: Where should I paste the Javascript code?
Last modified: December 6, 2018

---

# Where should I paste the Javascript code?

 *  [papijo](https://wordpress.org/support/users/papijo/)
 * (@papijo)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/where-should-i-paste-the-javascript-code/)
 * Using the WP Matomo Tracker version 1.2.3
    In the settings, Tracking Mode, if
   I select Javascript either external file or inlined, I really do not understand
   _where_ to paste the Javascript code that I am given by MATOMO. Something seems
   to be missing from the settings instructions.

Viewing 1 replies (of 1 total)

 *  Plugin Author [nir0ma](https://wordpress.org/support/users/nir0ma/)
 * (@nir0ma)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/where-should-i-paste-the-javascript-code/#post-10954757)
 * Hi [@papijo](https://wordpress.org/support/users/papijo/),
 * Matomo tracker acts as a proxy, so your javascript tracking code is not intended
   to be used … It’ll reveal your matomo install url which is not intended to avoid
   footprints.
 * What you need to have is :
    1 – A matomo instance installed on a custom domain
   name (ie : [http://mymatomoinstall.net](http://mymatomoinstall.net)), this is
   the “Matomo Installation Url” 2 – A custom user to get an Auth Token 3 – The 
   tracking id of your site
 * Assuming you have a js code like this one :
 * <!– Matomo –>
    <script type=”text/javascript”> var _paq = _paq || []; /* tracker
   methods like “setCustomDimension” should be called before “trackPageView” */ 
   _paq.push([‘trackPageView’]); _paq.push([‘enableLinkTracking’]); (function() {
   var u=”**[https://mymatomoinstall.com](https://mymatomoinstall.com)**/”; _paq.
   push([‘setTrackerUrl’, u+’piwik.php’]); _paq.push([‘setSiteId’, ‘**1**‘]); var
   d=document, g=d.createElement(‘script’), s=d.getElementsByTagName(‘script’)[0];
   g.type=’text/javascript’; g.async=true; g.defer=true; g.src=u+’piwik.js’; s.parentNode.
   insertBefore(g,s); })(); </script> <!– End Matomo Code –>
 * Your matomo url is the “var u=” part and your tracking ID is the “setSiteId” 
   number … Concerning the tracking ID you have some details here : [https://matomo.org/faq/general/faq_114/](https://matomo.org/faq/general/faq_114/)
 * Hope this might help you to understand

Viewing 1 replies (of 1 total)

The topic ‘Where should I paste the Javascript code?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/matomo-tracker_1c7678.svg)
 * [Matomo Tracker](https://wordpress.org/plugins/matomo-tracker/)
 * [Support Threads](https://wordpress.org/support/plugin/matomo-tracker/)
 * [Active Topics](https://wordpress.org/support/plugin/matomo-tracker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/matomo-tracker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/matomo-tracker/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [nir0ma](https://wordpress.org/support/users/nir0ma/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/where-should-i-paste-the-javascript-code/#post-10954757)
 * Status: not resolved