WordPress.org

Forums

s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members)
Google Analytics & Specific Post/Page Tracking Codes (1 post)

  1. ermilis
    Member
    Posted 1 year ago #

    Hello everyone,

    How do I properly enable the Google Analytics e-commerce tracking for the purchase of specific post/page access (not the usual subscription tracking)?

    I have tried the following code, but I am not successful:

    <script type="text/javascript">
    
      var _gaq = _gaq || [];
    
      _gaq.push(['_addTrans',
        '%%txn_id%%', // transaction ID - required
        '%%cv0%%', // affiliation or store name
        '%%amount%%' // total - required
      ]);
    
      _gaq.push(['_addItem',
        '%%txn_id%%', // transaction ID - required
        '%%item_number%%', // SKU/code - required
        '%%item_name%%', // product name
        '%%amount%%', // unit price - required
        '1' // quantity - required
      ]);
    
      _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
    
    </script>

    Any ideas?

    Thanks.

    https://wordpress.org/plugins/s2member/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by ermilis
  • This topic is not a support question
  • WordPress version: 3.8.3