The Page Tracker Service is a backend application built using Node.js and Express that enables tracking user interactions on a website. It integrates with Google Tag Manager and captures user activities such as page visits and button clicks. This service records user actions, device information, and page details for analysis using Google Analytics.
Features Getting Started Prerequisites Installation Usage Endpoints
Provides a landing page with buttons that record user actions when clicked. Captures user interactions, device details, and page information. Integrates with Google Tag Manager for enhanced analytics tracking. Supports viewing recorded user actions for analysis.
Node.js (v14 or later) npm (Node Package Manager)
1.Clone the repository:
git clone https://github.com/your-username/page-tracker-service.git- Navigate to the project directory:
cd page-tracker-service- Install dependencies:
npm installTo run the Page Tracker Service, execute the following command:
node app.jsBy default, the service will be available at http://localhost:3000.
- Displays a landing page with buttons to track user actions:
Landing Page: GET /- Records user actions, capturing details such as action type, timestamp, user agent, and page information:
Record User Action: POST /recordAction- Returns a JSON array containing recorded user actions for analysis:
View Recorded Actions: GET /viewActions