Adding analytics to a website or web application
For the tracking to work, you will need to embed Wide Angle Analytics code on your site. The approach might differ depending on your framework, language of choice or CMS. We provide an extensive list of integrations and guides for some of the most popular publishing platforms on the market.
If you use other solution, or your website is a custom implementation this guide will help.
No matter if you use static PHP pages or Single Page Application with React or VueJS, the principle is the same.
Enable Tracker Script
In the Site configuration screen in Wide Angle Analytics Dashboard, you can find a ready-made code snippet. Simply copy & paste it to the website source code or site generation engine.
Embed your site-specific code right before the end of HTML tag.
The resulting code of your site should look similar too:
<html> <head> <!-- HEAD section --> </head> <body> <!-- BODY section --> <script async defer src="https://stats.wideangle.co/script/UNIQUE_ID.js"> </script> </body> </html>
Optionally Prefetch Script
You can potentially improve performance of loading tracking script. By adding special hint, you will inform capable browsers, such as Chrome, Firefox and Safari, to download tracking script as soon as possible. This can improve overall site loading time even further.
To do so, add
link element to
<head> section of your website:
<head> <link rel="prefetch" href="https://stats.wideangle.co/script/UNIQUE_ID.js" </head>
Make sure your site is active and that the custom domain, if you use one, is verified.
That's it 🎉