파란 글씨가 구글 애널리틱스 넣은 소스 예시입니다.
그대로 복사해 넣으셔도 되는데 유의할점은 넣는 위치입니다.
additem의 경우 <TR> 태그 사이에 넣어주는게 포인트 인데, 이때 두번 넣어 주셔야 합니다.
메이크샵과는 다르게 비슷한 루핑을 돌리는게 두번 있거든요.
한 상품 주문과 두 상품 주문시에 소스가 분개 되는것 같습니다.
그럼 아래 소스 참고하셔서 성공하시기를!!

IMG_6138.jpg
(사진은 제 직촬 ㅋ. 물론 내용과 상관 없음.)
출처 http://cafe.naver.com/bizspring/2630

---중략---

    <!-- 주문완료 -->
    <div class="orderInfo">
        <p>
            <strong>고객님의 주문이 완료 되었습니다.</strong>
            주문내역 및 배송에 관한 안내는 <a href="/myshop/order/list.html">주문조회</a> 를 통하여 확인 가능합니다.
        </p>
        <ul>
            <li>주문번호 : <strong>{$order_id}</strong></li>
            <li>주문일자 : <span>{$order_date}</span></li>
        </ul>
    </div>

<!-- //구글 애널리틱스 이커머스 트래킹 STEP1 시작 -->
<script>

    //결제금액의 콤마 제거
    function removeComma(str){
        var removed_str = parseInt(str.replace(/,/g,""));
        return removed_str;
    }
    //상품명의 HTML 태그 제거 
    function removeHtml(str){
        var removed_str = str.replace(/<.*>/g,"");
        return removed_str;
     }
                                
   
  var productName;
  var skuCode;
  var productPrice;
                                        
  var orderId = '{$order_id}';
  var totalProductPrice = '{$total_product_price}';
  totalProductPrice = removeComma(totalProductPrice); 
  
  var totalShipFee = '{$total_ship_fee}';
  totalShipFee = removeComma(totalShipFee);  
      
  ga('require', 'ecommerce', 'ecommerce.js');           //구글 애널리틱스 이커머스 플러그인

  ga('ecommerce:addTransaction', {                      //구글 애널리틱스 주문정보 수집
  'id': orderId,                                        // Transaction ID. Required.
  'affiliation': 'flat iron',                           // Affiliation or store name.
  'revenue': totalProductPrice,                         // Grand Total.
  'shipping': totalShipFee,                             // Shipping.
  'tax': ''                                             // Tax.
});
    
</script>
<!-- 구글 애널리틱스 이머커스 트래킹 STEP1 끝 -->
    
    
    
    <!-- 결제정보 -->
    <div class="orderArea">
        <div class="title">
            <h3>결제정보</h3>
        </div>

        <div class="boardView">
            <table border="1" summary="">
            <caption>결제정보</caption>
            <tbody>
                <tr>
                    <th scope="row">최종결제금액</th>
                    <td class="price">
                        {$price_unit_head}<strong>{$result_order_price}</strong><strong class="tail">{$price_unit_tail}</strong> <span class="tail {$result_order_ref_display|display}">{$result_order_ref}</span>
                    </td>
                </tr>
                <tr>
                    <th scope="row">결제수단</th>
                    <td>
                        <strong>{$paymethod_name}</strong>
                        <p>{$paymethod_detail} <span class="{$bank_go_display|display}"><a href="#none" id="{$btn_bank_go_id}"><img src="/web/upload/design/basic/btn_banking.gif" alt="인터넷뱅킹 바로가기" /></a></span></p>
                    </td>
                </tr>
                <tr class="{$eguarantee_display|display}">
                    <th scope="row">전자보증보험<br/>서비스정보</th>
                    <td>{$eguarantee_detail}</td>
                </tr>
            </tbody>
            </table>
        </div>
    </div>

    <!-- 주문 상품 정보 -->
    <div class="orderListArea">
        <div class="title">
            <h3>주문 상품 정보</h3>
        </div>

        <!-- 기본배송 -->
        <table border="1" summary="" class="boardList {$normal_display|display}" nspace="normal">
            <caption>기본배송</caption>
            <thead>
                <tr>
                    <th scope="col" class="thumb">이미지</th>
                    <th scope="col" class="product">상품정보</th>
                    <th scope="col" class="price">판매가</th>
                    <th scope="col" class="quantity">수량</th>
                    <th scope="col" class="mileage">적립금</th>
                    <th scope="col" class="delivery">배송구분</th>
                    <th scope="col" class="total">합계</th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <td colspan="7"><strong class="type">[기본배송]</strong> 상품구매금액 <strong>{$normal_total_product_price}<span class="{$normal_total_option_price_display|display}"> ({$normal_total_option_price})</span></strong> + 배송비 {$normal_total_delv_price} + 지역별배송비 {$normal_total_special_delv_price} = 합계 : <strong class="total">{$price_unit_head}<span>{$normal_total_price}</span>{$price_unit_tail}</strong> <span class="{$normal_total_price_ref_display|display}">{$normal_total_price_ref}</span></td>
                </tr>
            </tfoot>
            <tbody module="Order_normalresultlist">
                <tr>
                    <td class="thumb"><a href="/product/detail.html{$param}"><img src="{$product_image}" onerror="this.src='http://img.echosting.cafe24.com/thumb/img_product_small.gif';" alt="" /></a></td>
                    <td class="product">
                        <a href="/product/detail.html{$param}"><strong>{$product_name}</strong></a>                        
                        <div class="option {$option_display|display}">{$option_str}</div>
                        <ul class="option" module="Order_optionSet">
                            <li><strong>{$product_name}</strong>{$option_str} ({$qty}개)</li>
                            <li><strong>{$product_name}</strong>{$option_str} ({$qty}개)</li>
                        </ul>
                        <p class="free {$card_installment_display|display}">무이자할부 상품</p>

<!-- 구글 애널리틱스 이머커스 트래킹 STEP2-1 시작 -->
<script>
  productName =  '{$product_name}';
  productName =   removeHtml(productName);
  productPrice =  '{$product_price}';
  productPrice = removeComma(productPrice); 
  ga('ecommerce:addItem', {
  'id': orderId,                     // Transaction ID. Required.
  'name': productName,    // Product name. Required.
  'sku': '',                 // SKU/code.
  'category': '',         // Category or variation.
  'price': productPrice,                 // Unit price.
  'quantity': '{$product_quantity}'                   // Quantity.
});              
</script>                         
<!-- 구글 애널리틱스 이머커스 트래킹 STEP2-1 끝 -->                        
                        
                    </td>
                    <td class="price"><strong>{$price_unit_head}{$product_price}{$price_unit_tail}</strong><div class="{$product_price_ref_display|display}">{$product_price_ref}</div></td>
                    <td class="quantity">{$product_quantity}</td>
                    <td class="mileage">{$product_mileage}</td>
                    <td class="delivery">기본배송<div class="{$oversea_able_display|display}">(해외배송가능)</div></td& gt;
                    <td class="total"><strong>{$price_unit_head}{$product_total_price}{$price_unit_tail}</strong><div class="{$product_total_price_ref_display|display}">{$product_total_price_ref}</div></td>
                   
                </tr>
               
                <tr>
                    <td class="thumb"><a href="/product/detail.html{$param}"><img src="{$product_image}" onerror="this.src='http://img.echosting.cafe24.com/thumb/img_product_small.gif';" alt="" /></a></td>
                    <td class="product">
                        <a href="/product/detail.html{$param}"><strong>{$product_name}</strong></a>
                        <div class="option {$option_display|display}">{$option_str}</div>
                        <ul class="option" module="Order_optionSet">
                            <li><strong>{$product_name}</strong>{$option_str} ({$qty}개)</li>
                            <li><strong>{$product_name}</strong>{$option_str} ({$qty}개)</li>
                        </ul>
                        <p class="free {$card_installment_display|display}">무이자할부 상품</p>
                        
                        
<!-- 구글 애널리틱스 이머커스 트래킹 STEP2-2 시작 -->                    
<script>
  
  productName =  '{$product_name}';
  productName =   removeHtml(productName);
  productPrice =  '{$product_price}';
  productPrice = removeComma(productPrice); 
  ga('ecommerce:addItem', {
  'id': orderId,                     // Transaction ID. Required.
  'name': productName,    // Product name. Required.
  'sku': '',                 // SKU/code.
  'category': '',         // Category or variation.
  'price': productPrice,                 // Unit price.
  'quantity': '{$product_quantity}'                   // Quantity.
});
                
</script> 
<!-- 구글 애널리틱스 이머커스 트래킹 STEP2-2 끝 -->                  

                    </td>
                    <td class="price"><strong>{$price_unit_head}{$product_price}{$price_unit_tail}</strong><div class="{$product_price_ref_display|display}">{$product_price_ref}</div></td>
                    <td class="quantity">{$product_quantity}</td>
                    <td class="mileage">{$product_mileage}</td>
                    <td class="delivery">기본배송<div class="{$oversea_able_display|display}">(해외배송가능)</div></td& gt;
                    <td class="total"><strong>{$price_unit_head}{$product_total_price}{$price_unit_tail}</strong><div class="{$product_total_price_ref_display|display}">{$product_total_price_ref}</div></td>
                </tr>
            </tbody>
        </table>
                        
---  중략 ---

<!-- 구글 애널리틱스 이머커스 트래킹 STEP3 시작 -->
<script>
  ga('ecommerce:send');
 
</script>
<!-- 구글 애널리틱스 이머커스 트래킹 STEP3 끝 -->
List of Articles
번호 제목 날짜 조회 수
공지 기타 내가 궁굼해 하는 것들을 다른 사람들도 궁굼해 한다면? file [182] 2012-01-05 133316
939 애견/동물 유기견 보호소 10일 후 안락사에 대한 법적 근거 2018-09-06 1232
938 동영상편집 환상의 콤비 프리미어 프로&애프터 이펙트&포토샵 CS6 file 2015-08-24 3228
937 쇼핑/직구/공구정보 10만원대 프린트, 웹서핑, 쇼핑, 금융 거래 전용 똑딱이 노트북,탭 구매 후보 2015-08-11 2667
936 회사경영/회계/재무/인사 CEO, CFO, CCO, CDO, CIO, CKO, CLO, CMO, CPO... 각 의미 정리 file 2015-08-10 19502
935 무역 무역 용어, 업무 정리 secret 2015-04-30  
934 Google 구글 검색 꿀팁 9개 file 2015-03-30 2000
933 회사경영/회계/재무/인사 개인회사로 남을까? 법인을 만들까? file 2015-03-06 3267
» 웹개발/웹디자인 cafe24 쇼핑몰에 구글 애널리틱스 소스 넣는 방법(펌) file 2015-03-04 8754
931 체험학습여행프로그램 워커랠리, 워크랠리란? file 2015-03-03 4973
930 창업/벤처/지원사업 '정부 지원과제 살펴보는것도 참 만만치 않네요.'라는 질문의 댓글(펌) file 2015-03-01 1766
929 건강_운동 당신의 몸을 변신시켜줄 7가지 운동방법 file 2015-02-26 2102
928 금연_전자담배 담배를 영원히 끊기위한 15가지 방법 file 2015-02-26 4727
927 생활상식/별별정보 닥공 : 해외여행 미니가이드북 무료 다운로드 file 2015-02-11 2568
926 작은집Project 보급형 이동식 목조주택 by 하우시스코리아 file 2015-01-26 5610
925 작은집Project 경량식 목조주택 by 하우시스 코리아 file 2015-01-26 3877
924 작은집Project 레고스타일, 옥탑방 개조 인테리어 아이디어 집짓기 file 2015-01-26 3198
923 건강_아토피 아무리 달고 짜고 독해도 먹을 수 있게 마들어주는 식품첨가물의 비밀. file 2015-01-19 3273
922 건강_일반/기타 Nopoo (샴푸 안쓰기) 맹물로 머리감기에 대해 샅샅히 정리, 검증, 체험 중입니다. file 2015-01-19 6356
921 건강_먹는거 이왕재 교수의 비타민C 이야기, 논란 재점화 file 2015-01-15 5296
920 건강_일반/기타 척추 명의 충격적 인터뷰! "척추수술 하지마라!" file 2015-01-11 3875

Top