top of page
Screenshot (255).png
  • Facebook

Like

Be the first of your friends to like this

LIKE THIS STORY ON FACEBOOK

Karan's Success Story

What I love about this program is that it is linked to the curriculum and what I am doing in class. I learn the lessons before going into class and know everything before the teacher even starts teaching. It makes my homework easier and I can complete it in half the time. I am always ready now and love being the smartest one in the class! 

bottom of page
import { sendPageViewToFacebook } from 'backend/facebookApi'; // Import backend function // Function to retrieve the client's IP address async function getClientIP() { try { const response = await fetch('https://api.ipify.org?format=json'); const data = await response.json(); return data.ip; } catch (err) { console.error('Error fetching client IP:', err); return null; } } $w.onReady(async function () { // Get user's IP, user agent, and page URL const clientIp = await getClientIP(); const userAgent = navigator.userAgent; // Get the user agent const pageUrl = `https://www.aplustudents.ca${window.location.pathname}`; // Get the full page URL // Prepare data for page view const pageViewData = { clientIp: clientIp, userAgent: userAgent, pageUrl: pageUrl }; // Send page view data to Facebook sendPageViewToFacebook(pageViewData) .then(response => { console.log('PageView event sent successfully:', response); }) .catch(error => { console.error('Error sending PageView event:', error); }); });