Home > Article > Backend Development > javascript - Can the var u = "installed url" in the piwik tracking code be replaced with an IP address?
I want to replace the url with the IP address in piwik’s tracking code to save the step of parsing
<code><!-- Piwik --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//linlin.ngrok.com/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', '11']); 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> <noscript><p><img src="//linlin.ngrok.com/piwik.php?idsite=11" style="border:0;" alt="" /></p></noscript> <!-- End Piwik Code --></code>
But changing var u in the code to the corresponding IP cannot be traced. I don’t quite understand. Do I need to modify any configuration of piwik?
I want to replace the url with the IP address in piwik’s tracking code to save the step of parsing
<code><!-- Piwik --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//linlin.ngrok.com/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', '11']); 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> <noscript><p><img src="//linlin.ngrok.com/piwik.php?idsite=11" style="border:0;" alt="" /></p></noscript> <!-- End Piwik Code --></code>
But changing var u in the code to the corresponding IP cannot be traced. I don’t quite understand. Do I need to modify any configuration of piwik?