Your guide to integrating FetchLytics with your applications.
If you are using a single-page application framework and Express.js, the process is straightforward.
We provide simple API's for frontend and backend
Include the following script in your HTML file
1<script src="https://fetchlytics.dev/tool/fetchlytics.umd.js"></script>
2
3<!-- Initialize Fetchlytics after the script is loaded -->
4<script>
5 console.log('Initializing Fetchlytics', fetchAnalytics);
6 fetchlytics.initialize({
7 appName: 'Hairsalon',
8 apiKey: 'flk_***********************************',
9 trackFetches: true,
10 trackResources: true,
11 });
12</script>
Include the following code in your app
$ npm install @fetchlytics/express-middleware
1const {trackRequestAnalytics} = require('@fetchlytics/express-middleware');
2// OR
3import {trackRequestAnalytics} from '@fetchlytics/express-middleware';
4
5// Initialize Fetchlytics
6const options = {
7 apiKey: 'flk_***********************************',
8 appName: 'Hairsalon',
9};
10
11app.use(trackRequestAnalytics(options));
* This is for an Express.js app
Thats it! Thats all you have to do to start tracking your sites!
However some important notes!
You can find your info when you are logged in and then under the "Apps" section
For other frameworks, you can check the API Reference.
Or you can write an email to support@fetchlytics.dev.