4

I am measuring conversion rates between two sites - one site (abc.com) has an iframe with registration form from another (cde.com). I need to measure REAL conversion rate, which means only successfull registrations. For this I am using server side google analytics library (https://github.com/dancameron/server-side-google-analytics) that sets an event when a registration is successfully completed.

I have to use events, since I have no thankyou.html pages, the other app is fully ajax based. Using cde.com as a thankyou.html page gives numbers like 98% conversion, which is not quite accurate. Besides that I only need to track registration that came from the abc.com.

I was able to achieve the event tracking but now I don't know, how to set the event in a way that tells GA that it came from a certain variation of abc.com.

This is the code, that sets the event. The parameters are similar to _gaq.push()

$ssga->set_event( "Category", 'Created an account' );
$ssga->send();
Elwhis
  • 1,241
  • 2
  • 23
  • 45

1 Answers1

2

Pass information from abc.com to cde.com using the query string:

<iframe src="cde.com?variation=1"></iframe>

Then include that information in the form at cde.com:

if (isset($_GET['variation'])) {
    echo '<input type="hidden" name="variation" value="' . $_GET['variation'] . '" />';
}

Then in your event-sending code, include the variation information:

if (isset($_POST['variation'])) {
    if ($_POST['variation'] == 2) {
        $ssga->set_event( "Category", 'Created an account', 'Variation 2' );
    }
    else $ssga->set_event( "Category", 'Created an account', 'Variation 1' );
}
else $ssga->set_event( "Category", 'Created an account, 'Variation 1' );
$ssga->send();
AlliterativeAlice
  • 11,841
  • 9
  • 52
  • 69
  • This is not exactly what I need. I need to distinguish registrations, that both come from abc.com, but abc.com runs A/B test and I need to track from which variation - A or B - the registration came from. – Elwhis Jul 01 '13 at 09:29
  • I've updated my answer to use an alternate method that should cover your situation. – AlliterativeAlice Jul 01 '13 at 19:56
  • That is something I thought of, but I want to track the same event (eg. Created an account), but let google analytics aassign it to the corresponding variation. – Elwhis Jul 02 '13 at 08:51
  • Edited the code again to provide a single event with the ability to drill-down to different variations. – AlliterativeAlice Jul 02 '13 at 14:44