# VWO Split url test setup ## Test variations in Logician web templates 1. Create copy of original template in Logician Webtamplates in vBulletin with the test changes. Please make sure you follow our naming convention. `{originalTemplateName-abt-{jiraTicket}-var-{variantNumber}` ![](https://i.imgur.com/C5bKIze.png) **NOTE:** Canonical Tag must be added pointing to the live site. In `PHP Include` add the following syntax: `$canonical = "https://www.cardschat.com/online-gambling.php";` <br><br> 2. Create RewriteRule for the variant page(s) in `.htaccess` file in the repository. We have a **different naming convention** for the URLs as we have to keep this as short as possible. The variant page URL should be the same as original page's URL but suffixed with random unique string. The variant page should use the same `viewX.php` file as the original page. Please see explanation below. ```bash # ORIGINAL RewriteRule ^mobile-poker.php$ view5.php?pg=mobilepoker [L,QSA] # VS # VARIANT RewriteRule ^mobile-poker-3yg.php$ view5.php?pg=mobilepoker-abt-cco-936-var-1 [L,QSA] ``` * The suffix in the variant URL must be unique. Think of 3 unique lowercase string including only numbers. (e.g.: `mobile-poker-3yg`) or [use this generator](https://passwordwolf.com/api/?upper=off&special=off&length=3&repeat=1). * In our case the original page is using `view5.php` therefore the variant must also use `view5.php` file. * Please place the RewriteRule to the dedicated section in `.htaccess` file, after the following line: `# VWO split url tests` <br><br> 3. Log in to VWO and switch board to *CC* ![](https://i.imgur.com/ZdwjXN1.png) <br><br> 4. Go to *Split URL* ![](https://i.imgur.com/bUv3myZ.png) <br><br> 5. Click *CREATE* ![](https://i.imgur.com/dhvXH3A.png) <br><br> 6. Fill campaign name with ticket number and title. ![](https://i.imgur.com/zCB7d9I.png) <br><br> 7. Select *H5* in *Select from existing hypotheses*. ![](https://i.imgur.com/nimM4la.png) <br><br> 8. Enter original URL in *Control* field and test variation in *Variation 1* field. Click *Add Another Variation* if necessary. ![](https://i.imgur.com/tThyCZP.png) <br><br> 9. Click *NEXT* and fill Goal fields with all URL's from the test. ![](https://i.imgur.com/Hvt6KQh.png) <br><br> 10. Click NEXT and FINISH. 11. Click Split URL and enter the completed test. ![](https://i.imgur.com/wE1JoC8.png) <br><br> 12. Click meatballs menu, then click email ![](https://i.imgur.com/uZQJanp.png) ![](https://i.imgur.com/5FDEUhm.png) <br><br> 13. Copy and share the URL from the email body with persone responsible for the test review. ![](https://i.imgur.com/ZkOffpV.png) --- ## Test variations in Styles & Templates Most of the steps for this are the same as for Logician web templates, but to add new template do the following: 1. Enter [cardschat.com/admincp/template.php?do=modify](https://www.cardschat.com/admincp/template.php?do=modify) 2. Under *Blue Theme - v4* click select list and then click *Add New Template* ![](https://i.imgur.com/RjhxjPY.png) <br> ![](https://i.imgur.com/pTGpX3l.png) <br><br> 3. Enter name and code for the new template. Our naming convention would apply here and the new template should be titled accordingly `{originalTemplateName-abt-{jiraTicket}-var-{variantNumber}` Make sure that *Style* is set to **Blue Theme - v4**. Otherwise the new template will be created in unused theme. ![](https://i.imgur.com/XmtRtOZ.png) <br><br> 4. After you see new template in **Blue Theme - v4** Styles&Templates you can use it as an include in different templates. ![](https://i.imgur.com/7xd96S0.png) <br><br> 5. If the new template is a separate `php` page, you need to update the file in the repository. In case of cardschat.com/canada/ the file will be `/canada.php`. To render new test variation you need to overwrite additional condition for `$templateName` with name of the new template. Consider following code: ```php // original template name $templateName = "pokersites-ca"; // condition that will check for `?abt=3hy` GET parameter, and if true $templateName will be overwritten if (! empty($_REQUEST['abt']) && $_REQUEST['abt'] == '3hy') { $templateName = "pokersites-ca-abt-cco-453-var1"; } // render the template eval('print_output("' . fetch_template($templateName) . '");'); ``` After this is done, new variation will appear under cardschat.com/canada/?abt=3hy. <br><br> 6. After submitting PR with the redirect "revert" PR from following template can be prepared, so we can remove the redirects after test finishes: https://bitbucket.org/legendcorp/cardschat.com/pull-requests/1259/split-test-revert-canada-add-ability-to/diff --- If you have any questions please let me know on [rocket chat](https://rockit.chat/direct/JakubMaksimowicz) :)