Bu Siteyi Ziyaret Etmek İçin Lütfen Tarayıcınızda JavaScript'i Etkinleştirin.


Konu Bilgileri
KATEGORİ ADI PHP
KONU SAHİBİ
uzman
KONUDAKİ CEVAP SAYISI
0
GÖRÜNTÜLEME SAYISI
599

Yorum Yaz 
Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5

PHP Google Analitik ID Bulucu

#1
Döküman 
Kodlar;

PHP Kod:
function fetchGoogleAnalyticsUAID($googleAnalyticsURL){
    // Script Regex
    $script_regex = "/<script\b[^>]*>([\s\S]*?)<\/script>/i";
    // UA_ID Regex
    $ua_regex = "/UA-[0-9]{5,}-[0-9]{1,}/";
    // Preg Match for Script
    // Extract all the script tags of the content
    preg_match_all($script_regex, file_get_contents($googleAnalyticsURL), $inside_script);
    // Check for ga.gs and _trackPageview in all <script> tag
    for ($i = 0; $i < count($inside_script[0]); $i++){
        if (stristr($inside_script[0][$i], "ga.js")) $flag2_ga_js = TRUE;
    }
    // Preg Match for UA ID
    // Extract UA-ID using regular expression
    preg_match_all($ua_regex, file_get_contents($googleAnalyticsURL), $ua_id);
    // Return UA ID
    return $ua_id[0][0];
}

Kullanımı;

PHP Kod:
echo fetchGoogleAnalyticsUAID("website_url");
Bul
Cevapla
Yorum Yaz 


[-]
Hızlı Cevap / Sende Bi' Şeyler De!
Konu
Bu mesaj için cevabınızı buraya yazınız.

İnsan Doğrulama:
Lütfen aşağıda gördüğünüz onay kutusunu işaretleyin. Bu işlem, otomatik spam botlarını önlemek için kullanılır.

Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
PHP Kırık Link Bulucu uzman 0 647 18-08-2021 Saat 23:33
Son Yorum: uzman


    Hızlı Menü:


    Konuyu Okuyanlar:
    ForumTeams
    ForumTeams