想通过PHP在referrer域中获取youtube ID吗? [英] Want to get youtube ID in referrer domain with PHP?
问题描述
我已经研究但没有找到适合这种情况的解决方案,请提供建议!
我想跟踪youtube视频的确切点击。
我尝试过:
一个名为trackid.php的PHP文件使用以下代码:
$ actual_link =(isset($ _SERVER [' HTTP_REFERER']))? $ _SERVER [' HTTP_REFERER']:' ';
echo $ actual_link ;
我使用goo.gl缩短了该文件的URL,并将缩短的URL放在Youtube视频的描述中。
我尝试打开缩短的网址,结果是
https://www.youtube.com/
但是我需要获得完整的URL,包括watch?v = sampleID,我想获得视频的ID用于跟踪目的。
请指教!
actual_link =(isset(
< blockquote> _SERVER [' HTTP_REFERER']))?
_SERVER [' HTTP_REFERER']:' ';
echo
I've researched but not found a solution for this situation, please advise!
I want to track where exactly click come from a youtube video.
What I have tried:
A PHP file named "trackid.php" with following code:
$actual_link = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : '';
echo $actual_link;
I shortened URL of that file using goo.gl, and place that shortened URL in the description of a Youtube video.
When I try to open the shortened URL, the result is
https://www.youtube.com/
But I need to get full URL including "watch?v=sampleID", I want to get ID of the video for tracking purpose.
Please advise!
actual_link = (isset(
_SERVER['HTTP_REFERER'])) ?
_SERVER['HTTP_REFERER'] : ''; echo
这篇关于想通过PHP在referrer域中获取youtube ID吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!