Archive for April 29th, 2009
Google Analytics Tracking Code 跟踪产品信息的js写法
<!– Google Analytics Tracking Code – Provided by PM Tian – START –>
<script type=”text/javascript”><!–
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
// –></script>
<script type=”text/javascript”><!–
try {
var pageTracker = _gat._getTracker(“UA-425001-1″);
pageTracker._setDomainName(“.dhgate.com”);
pageTracker._setVar(“Real Buyer”);
pageTracker._addTrans(
“1234″, // Transaction ID
“Mountain View”, // PayPal|Capinfo
“11.99″, // Total
“1.29″, // Tax, N/A
“5″, // Shippingfee
“San Jose”, // City
“California”, // State
“USA” // Country
);
pageTracker._addItem(
“1234″, // Order Number (PO)
“DD44″, // Item Code
“T-Shirt”, // Product Name
“Green Medium”, // Category Code
“11.99″, // Price – required
“1″ // Quantity – required
);
pageTracker._trackTrans();
} catch(err) {}
// –></script>
<!– Google Analytics Tracking Code – Provided by PM Tian – END –>
用geo查IP这个。。粉简单。。
inc文件在这里http://geolite.maxmind.com/download/geoip/api/php/geoip.inc 应该留着这个能更新一下
更精确的在 http://geolite.maxmind.com/download/geoip/api/php/geoipcity.inc
数据文件在
http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
-
#!/usr/bin/php -q
-
<?php
-
// This code demonstrates how to lookup the country by IP Address
-
include("geoip.inc");
-
// Uncomment if querying against GeoIP/Lite City.
-
// include("geoipcity.inc");
-
$gi = geoip_open("/usr/local/share/GeoIP/GeoIPCity.dat",GEOIP_STANDARD);
-
geoip_country_name_by_addr($gi, "24.24.24.24") . "\n";
-
geoip_country_name_by_addr($gi, "80.24.24.24") . "\n";
-
geoip_close($gi);
-
?>
Recent Comments