I recently had to create a second step “Thank you” page for a client so they could add their Conversion Tracking code to it. Most people will simply add the tracking code to the registration page and set the URLs in your Conversion Tracking software.
Some tracking software programs have trouble when it comes to using the same url for the start and the conversion goal. Here’s what i did to create a “Thank You” page.
- Open up your theme folder and copy the register.php template
- Rename it to thank-you.php (or anything you want really)
- Next open up thank-you.php and paste the following into it right at the top (line 1) to create a static page template.
<?php /* Template Name: Thank You Template*/ ?>
- Log into your backend and create a static page called “Thank-you” and select the “Thank Your Template” from the list.
- Next open up the register.php and insert the following line straight after the call for the register form. This uses javascript to change the action of the form to send to the thank-you page.
<script type="text/javascript"> var changer = document.getElementById('setupform'); changer.action = 'http://yoursite.org.za/thank-you';</script>
- Lastly to make sure no one visits this page except during the registration process add the following lines of code just below the <body> tag
I have attached the two file register.php and thank-you.php so you can see how i did it.
Leave a Reply