التدريب ساعدني أطور مهاراتي في اختبار استماع ايلتس والمحادثة، ورفعت درجتي في الآيلتس، وهذا خلاني أستوفي شروط الإقامة في أستراليا، المنصة كانت أساسية في تسهيل حصولي على درجة الايلتس المرغوبة!!
نورة
بواسطة
عمر مشهور
/ 10/09/2025
) */ (function () { 'use strict';// ─── CONFIG ─────────────────────────────────────────────────────────────── const APP_DOMAIN = 'app.goielts.ai'; const REL_VALUE = 'nofollow noopener noreferrer';const PAID_PARAMS = [ 'utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term', 'gclid', 'fbclid', 'ttclid', 'sclid', 'msclkid' ];const ORGANIC_UTM = { utm_source: 'goielts_mkt', utm_medium: 'organic', utm_campaign: 'cta_signup', };// ─── HELPERS ────────────────────────────────────────────────────────────── const pageParams = new URLSearchParams(window.location.search); const hasPaidParams = PAID_PARAMS.some(p => pageParams.get(p));function getPageSlug() { const parts = window.location.pathname.split('/').filter(Boolean); return parts.length > 0 ? decodeURIComponent(parts[parts.length - 1]) : 'homepage'; }function getPosition(link) { if (link.closest('.ast-primary-header-bar') || link.closest('.ast-mobile-header-wrap')) return 'header'; if (link.closest('#secondary') || link.closest('.sidebar-main')) return 'sidebar'; if (link.closest('.try-proInsightsNow-single-post-new')) return 'content_banner'; if (link.closest('.try-proInsightsNow-single-post.mobile')) return 'mobile_sticky'; if (link.closest('.entry-content') || link.closest('article')) return 'content_inline'; if (link.closest('#colophon') || link.closest('.site-footer')) return 'footer'; return 'other'; }// ─── MAIN PROCESSOR ─────────────────────────────────────────────────────── const positionCounters = {};function processLink(link) { try { const url = new URL(link.href); if (!url.hostname.includes(APP_DOMAIN)) return;// 1. Always enforce rel — SEO + security link.setAttribute('rel', REL_VALUE);// 2. Strip hardcoded Google Linker params (_gl, _gcl_au, _ga, _ga_*) // These are session-specific and must never be hardcoded in HTML const linkerKeys = []; url.searchParams.forEach((_, key) => { if (['_gl','_gcl_au','_ga','_gaexp'].includes(key) || key.startsWith('_ga_')) { linkerKeys.push(key); } }); linkerKeys.forEach(key => url.searchParams.delete(key));// 2. Paid params take full priority if (hasPaidParams) { PAID_PARAMS.forEach(param => { const value = pageParams.get(param); if (value && !url.searchParams.has(param)) { url.searchParams.set(param, value); } });// 3. Organic UTM — only if no campaign already set } else if (!url.searchParams.has('utm_campaign')) { const position = getPosition(link); positionCounters[position] = (positionCounters[position] || 0) + 1;Object.entries(ORGANIC_UTM).forEach(([key, val]) => { url.searchParams.set(key, val); }); url.searchParams.set('utm_term', getPageSlug()); url.searchParams.set('utm_content', `${position}_${positionCounters[position]}`); }link.href = url.toString();} catch (e) { console.error('GoIELTS Link Processor: Failed on', link.href, e); } }function processAllLinks() { document.querySelectorAll(`a[href*="${APP_DOMAIN}"]`).forEach(processLink); }// ─── INITIAL RUN ────────────────────────────────────────────────────────── // Footer placement = DOM already parsed, no DOMContentLoaded needed processAllLinks();// ─── MUTATION OBSERVER — catches dynamically injected banners/CTAs ───────── new MutationObserver(mutations => { mutations.forEach(({ addedNodes }) => { addedNodes.forEach(node => { if (node.nodeType !== 1) return; if (node.matches(`a[href*="${APP_DOMAIN}"]`)) { processLink(node); } node.querySelectorAll(`a[href*="${APP_DOMAIN}"]`).forEach(processLink); }); }); }).observe(document.body, { childList: true, subtree: true });})();