ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Thank you pages & URL segments

February 03, 2012 5:36am

Subscribe [3]
  • #1 / Feb 03, 2012 5:36am

    brash

    10 posts

    Hi all

    I’m creating a site at the moment that uses several forms. I need to set up individual “Thank you” pages for each form in order for our SEO team to track the number of forms completed.

    So I have a template group called ‘Membership’ and 2 templates that include forms called ‘Corporate enquries’ and ‘Register’. The URL’s so far looks like this:

    http://www.sitename.com/membership/corporate-enquiries
    http://www.sitename.com/membership/register

    I’ve set up a ‘Thank you’ page and at the moment, both forms go to:

    http://www.sitename.com/membership/thank-you

    Using this approach SEO are unable to track which form landed the users on the ‘Thank you’ page. What I really need is…

    http://www.sitename.com/membership/corporate-enquiries/thank-you
    http://www.sitename.com/membership/register/thank-you

    This is the first site I’ve built in EE so I’m struggling to get my head round how to properly structure it in terms of templates.

    Any advice would be appreciated!

    Michelle

  • #2 / Feb 03, 2012 6:52am

    Matt:P

    277 posts

    Hi Michelle

    Welcome to EE!

    What I do and this works well for me is create a template group called /thank-you/ which contains the various templates needed to track the progress of a lead/conversion/member sign up.

    So instead of your example the URLs could be:

    http://www.sitename.com/thank-you/corporate-enquiries
    http://www.sitename.com/thank-you/register

    Doing it that way allows you to keep your thank-you templates neatly in one place.

    What do you think?

    Matt

  • #3 / Feb 03, 2012 7:04am

    brash

    10 posts

    Ah ok.. I guess that’s one way of doing it - Thanks very much Matt! 😊

    I’m still curious to know if there’s a way of doing it like this though…
    http://www.sitename.com/membership/register/thank-you

  • #4 / Feb 03, 2012 7:35am

    John St-Amand

    865 posts

    I do it that way all the time.  The way I do it, the segment isn’t its own template, is just a segment to give EE the info it needs to know how to behave.  So I have something like domain.com/contact that has a form in it (generally I use Freeform for forms). On submit, i push the user to domain.com/contact/thanks.  I wrap the contact template with a conditional like:

    {if segment_2 == "thanks"}
    insert thank you message
    {if:else}
    insert form
    {/if}

    Because of the way EE parses the templates, as long as there is no actual “thanks” template, and there IS a contact index template, EE will attempt to load the contact index template even when the “artificial” segment 2 is in the URL.  And so then the conditional in the template takes over, telling EE to display different content when the second segment is present and matching our conditional criteria.  It’s worked like a charm for me.  I’ve not looked specifically, but i see no reason that Google Analytics would not report the /contact/thanks traffic separately since it is a distinct URL even if it is using the same template under the hood.

    Hope that helps.

  • #5 / Feb 03, 2012 11:25am

    brash

    10 posts

    Perfect - I wondered if I could do it like that but wasn’t sure if it’d effect analytics in terms of ‘contact’ and ‘contact/thanks’ effectively being the same page template.

    I guess I need to remember that the templates are just that, and it’s the URL the template generates that counts! 😊

    Thanks for your help guys!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases