mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 02:01:40 +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
16
addons/google_analytics/conf/info.xml
Normal file
16
addons/google_analytics/conf/info.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<addon version="0.1">
|
||||
<title xml:lang="ko">Google Analytics</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 9. 19">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<description xml:lang="ko">
|
||||
Google Analytics 코드를 사이트에 추가할 수 있습니다.
|
||||
</description>
|
||||
</author>
|
||||
<extra_vars>
|
||||
<var name="uacct">
|
||||
<title xml:lang="ko">uacct</title>
|
||||
<description xml:lang="ko">Google Analytics 코드의 _uacct 값을 입력해주세요.</description>
|
||||
</var>
|
||||
</extra_vars>
|
||||
</addon>
|
||||
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