Piwik analytics with amember

Discussion in 'aMember Pro v.4' started by mutualadvantage, Mar 14, 2012.

  1. mutualadvantage

    mutualadvantage New Member

    Joined:
    May 3, 2006
    Messages:
    7
    While Google analytics is good I do like to cross check and have a bit of independence from big brother which is why I decided to use Piwik for my analytics and ecommerce tracking. I'm now trying to get the ecommerce element working with amember and need a bit of help please.

    I've read through the available help and forum posts in both forums and have got as far as I can as I'm not a coder.

    If I understand correctly I need to add some java script to my amember thanks.phtml file.

    To track ecommerce orders Piwik uses two functions found here

    In the amember forums I found this thread helping with tracking conversions which gave me an idea of what I might use to populate the functions with the correct data, some of it is PHP and some smarty(?). Below I've added those snippets I've identified.

    Code:
    productSKU,- '{$p.product_id}'
    
    productName,- <?php p($p->item_title)?> or {$p.title}
    
    productCategory,-
    
    price,- <?php echo ($invoice->first_subtotal) ?>
    
    quantity -
    
    orderId, - '{$payment.payment_id}'
    
    grandTotal,- <?php echo ($invoice->first_total) ?>
    
    subTotal,- <?php echo ($invoice->first_subtotal) ?>
    
    tax,- <?php echo ($invoice->first_tax) ?>
    
    shipping,
    
    discount,
    Is this the best way to collect the data needed?
    Would the following javascript work/is this what i need to add to thanks.phtml?

    Code:
    <script type="text/javascript">
    
    piwikTracker.addEcommerceItem('{$p.product_id}', '{$p.title}', productCategory, <?php echo ($invoice->first_subtotal) ?>, quantity);
    piwikTracker.trackEcommerceOrder('{$payment.payment_id}', <?php echo ($invoice->first_total) ?>, <?php echo ($invoice->first_subtotal) ?>, <?php echo ($invoice->first_tax) ?>, shipping, discount);
    
    </script>
    thanks in advance for any help or the solution.





  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Look at files
    amember/application/plugins/misc/getclicky.php
    and
    amember/application/plugins/misc/google-analytics.php
    for examples, or let me know if you have no programming skills.
  3. mutualadvantage

    mutualadvantage New Member

    Joined:
    May 3, 2006
    Messages:
    7
    Thanks for the point in the right direction. I'll see how I get on.

    For anyone else following along the correct path appears to be /amember/application/default/plugins/misc
    relapse likes this.
  4. chrome62

    chrome62 Member

    Joined:
    Apr 22, 2008
    Messages:
    90
    Any luck ever getting piwik to work with amember?
  5. yali

    yali aMember Pro Customer

    Joined:
    Oct 14, 2014
    Messages:
    8
    Refreshing this thread -- is there an analytics/ecommerce plugin available for Piwik/Matomo?
  6. dale_s

    dale_s aMember Pro Customer

    Joined:
    Apr 12, 2013
    Messages:
    96
    Would also like to see a working plugin for Piwik/Matomo.
  7. jenolan

    jenolan aMember Coder

    Joined:
    Nov 3, 2006
    Messages:
    510
    It was working no one bothered to talk to me ... so it is archived

Share This Page