mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-23 12:22:15 +09:00
Google Analytics 코드 삽입 애드온 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2620 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
1d45f520e1
commit
283fc4d60f
2 changed files with 43 additions and 0 deletions
27
addons/google_analytics/google_analytics.addon.php
Normal file
27
addons/google_analytics/google_analytics.addon.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
if(!defined("__ZBXE__")) exit();
|
||||
|
||||
/**
|
||||
* @file google_analytics.addon.php
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief google analytics 코드를 사이트에 추가함
|
||||
**/
|
||||
|
||||
// 관리자 모듈이면 패스~
|
||||
if(Context::get('module')=='admin') return;
|
||||
|
||||
// 한번만 출력시키기 위해 전역변수에 호출되었음을 체크해 놓음 (called position과 상관없음)
|
||||
if($GLOBALS['_called_ga_']) return;
|
||||
$GLOBALS['_called_ga_'] = true;
|
||||
|
||||
$js_code = <<<EndOfCss
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "{$addon_info->uacct}";
|
||||
urchinTracker();
|
||||
</script>
|
||||
EndOfCss;
|
||||
|
||||
Context::addHtmlFooter($js_code);
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue