Google Analytics Experiments - Experiment Selection

I measure conversion rates between two sites - one site ( abc.com ) has an iframe with a registration form from another ( cde.com ). I need to measure the conversion rate REAL, which means only successful registration. To do this, I use the server-side Google Analytics library ( https://github.com/dancameron/server-side-google-analytics ), which sets an event when the registration is completed successfully.

I need to use events since I do not have thankyou.html pages, another application is entirely based on ajax. Using cde.com as the thankyou.html page yields numbers such as 98% conversion, which is not entirely accurate. In addition, I only need to track the registration that appeared in abc.com .

I was able to do event tracking, but now I don’t know how to set the event so that it abc.com GA that it came from a specific abc.com variant.

This is the code that sets the event. Parameters are similar to _gaq.push()

 $ssga->set_event( "Category", 'Created an account' ); $ssga->send(); 
+4
source share
1 answer

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

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

Then include this information in the form on cde.com:

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

Then, in your event sending code, provide information about the options:

 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(); 
+2
source

Source: https://habr.com/ru/post/1487114/


All Articles