latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

API or URL code for comparing A/B split tests

Home Forums Community Forum API or URL code for comparing A/B split tests

This topic contains 13 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 4 months ago.

Topic Author Topic
Posted: Thursday Aug 2nd, 2012 at 11:57 am #21025

Hi! I had started a thread here http://www.s2member.com/forums/topic/split-testing-two-sales-funnels/ which was closed for some reason (I needed a few weeks to prepare the two versions of my page and their respective videos), although my basic question was indeed asked about if they work or not.

But I wanted to follow up about the API code suggestion.

The options I have in VWO fr if a goal is triggered are explained by them as follows in their instructions:

————-
To measure the peformance of your website, you can track visitor actions as different goals in this test.

Click on a link: triggers when visitor clicks on a link to a URL or URL pattern of links
Visit a page: triggers when a visitor visits a URL or a page that matches the URL pattern of pages
Submit a form: triggers when a form is submitted to a URL or URL pattern of form actions (the URL here is the one used in action attribute of tag)
Engagement: triggers when visitor clicks on any link on the page. (This goal is reverse of bounce rate).
Custom conversion goal: triggers whenever a custom JavaScript function is called on the URL or URL pattern.
Revenue Tracking: track revenue generated by the visitor on the URL or URL pattern (integration instructions will be shown in code snippet tab).

————-
How can I combine this with the Dashboard -› s2Member® -› API / Tracking as suggested?

I’m not sure which code to implement and how to apply it such that it triggers a goal in the options above. I read through some of the options on the API/Tracking page, and am still at a loss regards how to apply this to my situation. I am already using the Signup Tracking Codes for iDevaffiliate, but I just copied and pasted that code.

Thoughts appreciated!

  • This topic was modified 4 years, 5 months ago by  Benny Lewis.
  • This topic was modified 4 years, 5 months ago by  Benny Lewis.
  • This topic was modified 4 years, 5 months ago by  Benny Lewis.

List Of Topic Replies

Viewing 13 replies - 1 through 13 (of 13 total)
Author Replies
Author Replies
Posted: Friday Aug 3rd, 2012 at 7:22 am #21086

Hi Benny.

I had started a thread here http://www.s2member.com/forums/topic/split-testing-two-sales-funnels/ which was closed for some reason

Oh, the forum automatically closes threads that haven’t been replied to in a certain ammount of time.

I’m not sure which code to implement and how to apply it such that it triggers a goal in the options above. I read through some of the options on the API/Tracking page, and am still at a loss regards how to apply this to my situation.

Well, I’m not experienced with VWO, so I’m not sure what they give you in order to track those things. Is it some JS you add to your page, or do you point your URLs to a script that tracks and then forwards to the actual page?

If it’s about adding a certain code that would load a URL of theirs to track things off-site, or locally if you VWO is run from your server, you could add that script/pixel to one of the boxes in the Tracking API when they are relevant to what you want to measure. You can also use the Notifications API, which has more options, but in those, instead of adding a script to your page, they’d load a URL you enter, which could have the code you need for VWO.

If you need to add the tracking to the form submission, when it goes in the actual form you’d need to edit the code for the pro-form, but if it can go after, then the Tracking/Notification API could do the trick. Or you can have the tracking code added to a custom success page you send the person to after checkout, for example.

Does that help?

Posted: Saturday Aug 4th, 2012 at 6:07 pm #21160

Thanks for the reply.

“Well, I’m not experienced with VWO, so I’m not sure what they give you in order to track those things.” – that’s the point, it’s not about what THEY give me, it’s what s2member gives me! They rely on URL appending (like *?*utm_campaign=your_campaign* ), or an unspecified script being run, and everything else I listed as proof of a conversion. They presume this is part of the site’s set-up in some way.

There are no separate URLs to be called, or pixels or anything of the like that I can see.

I need s2member to produce some data that they can latch on to. What kind of URL is the user sent to after a successful payment? Can I check this without actually making a payment myself? http://www.mysite.com/signupform.php?success or what?

And most importantly, how can I add some code to the payment button [s2Member-PayPal-Button level="3"....] (at the moment I can add price, currency, level of access provided etc.) that can demonstrate that it is either funnel A or funnel B, when they arrive on either the a) sign up page to enter their username and password, immediately after payment or b) the welcome page.

The only thing I can think of is to create different access levels for the two funnels, and ultimately give them the same file access but run a script on the welcome page that is level restricted, to take advantage of the custom conversion option.

The problem is that I don’t know what script to run for this, and I’d rather not use an entire level for people for this test, so for me the absolute easiest option would be if some code in the button controlled SOMETHING in the actual URL itself for sign-up, even if if there was some way to just add on a ?groupA or ?groupB to the URL, or a second slightly different version of the sign-up page or whatever.

Do you know what I mean? It’s not about tracking pixels and the like (that I’m aware of), simply a particular URL being accessed. Hopefully you have some suggestions, that involve either a small change to my button code or an understandable use of the API option.

Posted: Tuesday Aug 7th, 2012 at 1:02 am #21309
Raam Dev
Username: Raam
Staff Member

Benny,

You could simply add the required query string variables to the end of a URL that you specify in the success=”” attribute of the shortcode. When someone completes purchase, they will be sent to the URL you specify there. So, you could specify something like http://example.com/thank-you/?utm_campaign=your_campaign&group=A, or whatever you need. That Thank You page would then need to do whatever work is necessary for the tracking.

Posted: Tuesday Aug 7th, 2012 at 3:47 am #21331

Yes Raam, that’s precisely what I’m talking about!!
Could you be more specific about how I’d add that success attribute to the shortcode though?

Is this a variable in [s2Member-PayPal-Button...] ? If so, can you give me an example of how to use it?

I’m not sure if I have a thank-you page. The user is sent directly to the sign-up page to enter their username details after payment. THIS is ideally the page I’d like to add something like group=A to the URL. Could you let me know specifically how I may do this?

Thanks!

Posted: Wednesday Aug 8th, 2012 at 5:37 am #21460

Benny, you can just add the [hilite mono]success[/hilite] attribute with its URL at the end of the attributes in the shortcode. Pre Sale FAQs » Is there a way to force a custom redirect after a successful purchase?

[hilite path]Dashboard -› s2Member® -› PayPal® Buttons -› Shortcode Attributes -> success[/hilite]
[hilite path]Dashboard -› s2Member® -› PayPal® Pro Forms -› Custom Return URLs Upon Success[/hilite]

About the variables in the URL, you can change them dynamically with some PHP based on what you’re tracking. http://www.primothemes.com/forums/viewtopic.php?f=36&t=1604

[hilite pre_code]
[[s2Member-PayPal-Button ... success="http://example.com/success?group=" /]]
[/hilite]

Does that help? :)

Posted: Wednesday Aug 8th, 2012 at 5:57 am #21463

Thanks for the specific details Cristián! Last question:

Is that thank you page fully secured, and only accessible after payment? (If not by default, how can I be sure of it not being accessible by simply copying the URL elsewhere) If it is, then I can simply add the Free Registration Form on it, and I’d have everything I need with a custom URL for the sign-up page.

Appreciate a quick hint and then I should hopefully have all the information I need. Thanks!!

Posted: Wednesday Aug 8th, 2012 at 7:15 am #21469

No problem. :)

No, that page would not be secured, since it should be accessible to someone that doesn’t even have an account yet. If you protect it, the person will be redirected to the Membership Options page.

So, no, the free registration pro-form would not be safe there, but you can have there a link to the normal registration page, i.e. wp-login.php?action=register which, if you have registrations closed, will only work for someone that just checked out and was cookied by s2Member on return.

Posted: Wednesday Aug 8th, 2012 at 9:09 am #21507

OK, that’s all I needed to know. I’m pretty sure I’ve got everything to make this work. Thanks for your help! Will follow up in a few days if I run into problems. If not, then it’s because it’s all working smoothly!

Thanks!

Posted: Wednesday Aug 8th, 2012 at 11:44 am #21525

OK, I do have a follow up question in the end. It’s looking likely this will be the last one if I can get it to work.

VWO requires that you edit the page from the outside, in its own interface separate to WordPress. This means that you can change all the text and images that it sees, appropriate to the visual or text differences of a particular test group. You cannot however edit the button code, as that is hidden to the outside.

This isn’t a huge problem if I can just get a variable to be sent from one interface to the other. You can edit HTML within their interface, so I tried to use the little PHP I know to implement

<?php $group=1 ?>

or

<?php $group=2 ?>

at the start of the page, and then just call this variable within the button code in WordPress and that will help me get a particular goal as

http://mysite.com/thank-you?group="<?php echo $group ?>"

, so I know I could add this variable into the URL too.

But the problem is that their interface supports javascript API code but NOT PHP code. Their default javascript code to be edited is:

<script type='text/javascript'>
// The following API function is called just before a variation is inserted. The variation is passed to the function as a (wrapped up) DOM element. Control is a DOM element on the page which will be replaced by the variation. Remove all comments here for faster loading tests. 

_vwo_api_section_callback[VWO_SECTION_ID] = function(variation, control)
{
	// jQuery is available as shorthand vwo_$. Example: vwo_$(variation).css('font-size', 'larger'); 
	
	// INSERT YOUR CODE HERE
	
}
</script>

Is there some way to allow Javascript and PHP to play together nicely? i.e. create a variable within Javascript on their interface, but call it in PHP on my interface so that I can add it into the URL?

My other question is this (because I’m not so great with coding as you may have guessed). Will that variable only be stored for that user while they are on that page, or can it stay with them for their current session? There are 3 pages for them to look at, each one with buy buttons, and I want to make sure they are clicking the buy button appropriate to their goal group.

I’m pretty sure this is the very last hurdle for me to get over and then I can have a fully operational A/B test!

  • This reply was modified 4 years, 5 months ago by  Benny Lewis.
Posted: Wednesday Aug 8th, 2012 at 12:24 pm #21528

Their support got back to me and confirmed that PHP is server side and is run first, so I have to figure out an alternative way to get this to work :(
I’m going to see if I can just force two buttons on the main site and then have the A/B code select whichever one it is going to call and hide the other one, where the code is within that button. It’s a low-tech solution to the problem, but will hopefully work. Will update with final confirmation if it works.

  • This reply was modified 4 years, 5 months ago by  Benny Lewis.
Posted: Thursday Aug 9th, 2012 at 4:33 am #21601

I’m sorry, I don’t know JavaScript, other than that it’s client side… Sorry I can’t help you with that one.

Looking forward to your solution! I hope it isn’t too much trouble to get it working the way you want. :)

Posted: Thursday Aug 23rd, 2012 at 6:57 am #22827

Just wanted to say that I solved this problem! If anyone is interested, what I did was to simply write the two sales pages one after the other, with the different links required within each one. Then in the A/B test I made it such that each test would display just one half of the page.

This meant disabling the default of displaying the entire page, but it was way simpler and gets the job done and is working great! So if someone else wants to try this, just put BOTH buttons on the same page and remove one or the other in your tests.

Consider the thread closed. Thanks!

Posted: Friday Aug 24th, 2012 at 7:41 am #22945

That’s great, Benny! Nice work! :)

Viewing 13 replies - 1 through 13 (of 13 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.