Split Test Accelerator usage question

Discussion in 'Templates customization' started by davidm1, Dec 4, 2006.

  1. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    I'm trying to use Split Test Accelerator with amember, so I've placed this code in the header.html template, before the <html> tag (tried after too):
    {php}
    global $id, $f, $code;
    $id=4;
    include('/home/site/public_html/sta/topper.php');
    {/php}

    Then later to get the output:
    {php}
    if ($f[1]==1) {echo $code[1];}
    if ($f[1]==2) {echo $code[2];}
    {/php}

    But I'm not getting anything in the output. php in smarty is running properly when I just do a simple {php} echo 'test'; {/php}

    Any ideas?
    Thanks
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Please contact us via helpdesk.
  3. 123Marketing

    123Marketing Member

    Joined:
    Jun 4, 2005
    Messages:
    138
    aMember and Split Test Accelerator

    I was able to merge aMember and Split Test Accelerator by coding thanks.php (not thanks.html) with this:

    Code:
    <?php $id=1; include('/home/user/public_html/sta/TY_topper.php');?>
    
  4. dan_kelly

    dan_kelly New Member

    Joined:
    Aug 29, 2006
    Messages:
    91
    Thanks Markus.

    You're solution is for the tracking of transactions, but david is asking about the "topper" code (that goes on the page he's testing & must be at the very top b/c is sets cookies) not "TY_topper" code.

    Why I try to put the code at the top of signup.php, I get a session error:

    line 1807 is "session_start();"

    line 1651 is "header("Content-type: text/html; charset=".$GLOBALS['_LANG'][$lang]['encoding']);"

    If anyone has the solution, I am in need of it as well.
  5. incomehero

    incomehero New Member

    Joined:
    Jul 28, 2009
    Messages:
    12
    Daniel, were you able to figure this one out? I'm still waiting answer from STA creators on this...
  6. powerkeys

    powerkeys Member

    Joined:
    Aug 29, 2006
    Messages:
    192
    I've used STA with aMember, and I haven't run into any problems with the sales page, since this usually takes place before aMember gets involved. On the sales page, I just include a link to aMember's signup page and all's good.

    The problem I HAVE run into is with the thank you page code, which seems to interfere with aMember's processing. When I added the TY_topper.php include statement, I did so in the thanks.php file right before the line:

    $t->display("thanks.html");

    I haven't yet tested placing it at the top of the thanks.php file, which may fix the issue.
  7. incomehero

    incomehero New Member

    Joined:
    Jul 28, 2009
    Messages:
    12
    Let me get this straight... Here's the buying process on amember:

    Sales Letter -> aMember's Signup Page -> Payment Processor -> aMember's Thank You page

    Now, there's NO PROBLEM getting your STA work on sales letter, mainly because it's not amember's territory yet, so you just insert simple PHP lines there.

    But my problem is not that... I want to TEST different styles of my aMember's signup page. I want to test different colors of signup order form, different headlines, testimonials, and, of course, order page copy.

    To do that you have to insert your STA include code:

    PHP:
    <?php $id=14; include('/home1/public_html/sta/topper.php');?>
    ...and here's where all hell breaks loose, because when later you to get the output code:

    PHP:
    <?php
    if ($f[1]==1) {echo $code[1];}
    if (
    $f[1]==2) {echo $code[2];}
    ?>
    ...you're not getting anything in the output.

    Like mentioned above, even when you convert this php code into smarty, doesn't do the trick.
  8. erwinvdb

    erwinvdb aMember Pro Customer

    Joined:
    Aug 30, 2007
    Messages:
    264
    Where are you adding the code? in the templates/signup.html or signup.php
  9. incomehero

    incomehero New Member

    Joined:
    Jul 28, 2009
    Messages:
    12
    Tried adding:

    PHP:
    {php$id=14; include('/home1/public_html/sta/topper.php');{/php}
    and

    PHP:
    {php}
    if (
    $f[1]==1) {echo $code[1];}
    if (
    $f[1]==2) {echo $code[2];}
    {/
    php}
    to the signup.html
  10. powerkeys

    powerkeys Member

    Joined:
    Aug 29, 2006
    Messages:
    192
    Okay, I understand now -- you're testing the signup page itself and not the sales page.

    With STA, you have to add the topper code before ANY headers are sent, so I suspect you'll need to add it to the signup.php file, not the html template file.

    Try adding the topper code as the first lines in the signup.php file and see how that works.
  11. dan_kelly

    dan_kelly New Member

    Joined:
    Aug 29, 2006
    Messages:
    91
    No not yet. I put a support ticket in to the aMember guys, but all they told me so far was to add "global $id, $f, $code;" to the topper code... which I had already added from David's ORIGINAL example.

    And, no; it didn't help.


    I've added it to the top of signup.php, with no luck.

    ---

    Hold on...

    I think I've found a working combination!! :)

    1. the standard topper.php code at the very top of signup.PHP - the PHP file, *not* the HTML template.

    2. this line at the top of signup.HTML
    Code:
    {php}global $id, $f, $code;{/php}
    3. the STA output code converted to smarty

    Example:

    Code:
    {php} if ($f[1]==1){echo $code[1];} {/php}
    {php} if ($f[1]==2){echo $code[2];} {/php}
    {php} if ($f[1]<1){ {/php}
    <!-- ERROR: $f not set -->
    {php} } {/php}
    

    This is currently working in my setup, on my server.

    I'm going to do some more testing, but I think it's going to be a winner.


    If you find any problems/solutions, please post them to this thread.
  12. incomehero

    incomehero New Member

    Joined:
    Jul 28, 2009
    Messages:
    12
    OMG! It works -- at least code output.

    I'll do some more testing and get back with results/bugs ASAP. Thank you for this, Daniel!

    ---

    One interesting thing so far... If you refresh your page the variation changes, so it seems as STA doesn't set and read cookies to display the same test variation to the same visitor.

    ---

    Yeah, somehow STA now ignores the part of creating Cookies to display the same variation to the same user. But what's even worse, without cookies you won't be able to track which your test's variation is converting.

    I'll try to look for the solution and report back if am able to see what's wrong here. :/
  13. dan_kelly

    dan_kelly New Member

    Joined:
    Aug 29, 2006
    Messages:
    91
    you're welcome.

    I'm not getting that cookie problem.

    I've reloaded my page 12 or times, and I see the same page each time. And, I see that the "reloads" count goes up in the STA 'report'.

    I'll add conversion tracking today, and let you know how that goes.

    ---

    FYI... the cookie's name is "vacookie".

    Example value = "a:11:{i:0;i:4654;i:1;i:0;i:2;i:0;i:3;i:0;i:4;i:0;i:5;i:0;i:6;i:0;i:7;i:0;i:8;i:0;i:9;i:0;i:10;i:0;}"

    ---

    When I delete vacookie and reload I get a new STA salesletter. I can reload several times, and I still get the same page.
  14. erwinvdb

    erwinvdb aMember Pro Customer

    Joined:
    Aug 30, 2007
    Messages:
    264
    I think if one sees a page generated by STA you don't want the customer to see another page when he comes back but display the same page again.

    I believe you need to set something as your own IP as admin, then when you reload you'll see a new page every time you do a refresh (at least that's the case with my test software).
  15. incomehero

    incomehero New Member

    Joined:
    Jul 28, 2009
    Messages:
    12
  16. erwinvdb

    erwinvdb aMember Pro Customer

    Joined:
    Aug 30, 2007
    Messages:
    264

Share This Page