1

I'm having a problem when trying to A/B test certain nodes in my node-tree in Umbraco. What I want to do is to copy a node in the node-tree to a specific spot and use that B-structure to see which of the structures works best, using Google analytics.

For example we have two node structures, let's call them "Private" and "Sweden". Their structure with childnodes and properties are exactly the same. The only difference between them is the propertyvalues (content). The "Private"-URL is www.mysite.com/Private and the "Sweden"-URL is www.mysite.com/Sweden.

What I would like to do is to change every link on the B-structure, so that it points to its match at the A-structure. The problem is that since it's two different structures, it will have two different alternative links.

With other words, it should be a coinsidence that it enters the B-structure, then be moved back to the A-structure in the next click.

We manage what page it should load (either the A-node or the B-node) with scripts, so that it has a 50% chance for each node, and if it lands on the B-node, Google analytics will save data. What we can't manage is that every link on that page will be to the A-node.

I'd appreciate any help I can get.

Regards, David

David Nyqvist
  • 51
  • 1
  • 8

3 Answers3

1

There's a couple of ways that seem likely to give you a start at least.

The /config/urlrewriting.config file allows you to set up multiple redirect rules within umbraco so a section like the following might work in sending all requests (whether (/sweden/pagename/ or /private/pagename/) back to the private structure. Not sure how GA will handle it:

rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="http://www.mysite.com/private/$1" redirect="Domain" redirectMode="Permanent" ignoreCase="true" />

Secondly a simple httpmodule (http://support.microsoft.com/kb/307996) can process all page requests and redirect as required - you could do a gaq_push here directly or indirectly.

I'd be interested to know how you get on - it seems a good area for extension to Umbraco.

amelvin
  • 8,919
  • 4
  • 38
  • 59
  • Hi amelvin! I see your point. The thing is I do not want to redirect to another page, when entering the B-structure, I still want to be on the B-node to see the propertychanges made there, and from that node (for example when i click a link in the headermenu) be linked to the matched page in the A-structure. Hard case to solve, at least in my mind. – David Nyqvist Apr 24 '13 at 11:46
  • @DavidNyqvist The answer (I think) then is to add an httpmodule, redirect to A/B from there and use it to populate google events in the module. Then the nav and everything can be freed up from the dual structure. – amelvin Apr 24 '13 at 12:22
  • Thanks for your input, i'll give it a go and come back to you! – David Nyqvist Apr 25 '13 at 09:01
  • Giving it some thought, I'm still not sure if this is the way to go. The navigation won't be freed up from the dual structure, because it still got its alternative links from umbraco. Which means that by default it will have those links. In my code all the links are relative, since a template can be used for several pages. – David Nyqvist Apr 26 '13 at 07:06
1

I'm not sure I have understood perfectly what you need to do, so please excuse any assumptions that may prove mistaken. Here's what I think:

Since A & B nodes should share the same html content (besides the links of course), why don't you make the link href attribute dynamic by using a bit of razor in the template or macro:

    @{var isANode = CurrentPage.Parent.Name == "Sweden"; }
    <a href="/@(isANode ? "Private": "Sweden")/something/somethingelse.aspx"></a>

A similar approach would work if you are using web forms.

elolos
  • 4,310
  • 2
  • 28
  • 40
  • Hello, elolos! Thanks for your input. That could be an idea aswell, I will look over that solution and get back to you if it worked. The things is we have some links via javascript aswell, so it might be a problem to create dynamic links that way, unfortunately. I'll give it a go! – David Nyqvist Apr 26 '13 at 06:57
0

We finally came to the final decision to use the alternative template-solution. Since there seem to be no generic solution for my case of this problem we had to create an alternative template with specific macros to render the different information for every documenttype we're using.

Creating dynamic links for every page is a hell of a job in this stage in the project, since there are so many pages and links. Also some links are made in javascript, so there's another problem.

I copied the a-structure to another node, only for the reason to be able to change propertyvalues. There might be a problem logging and track the information with Google Analytics though, so that's the next step for us in this project. In our alternative templates we're getting the propertyvalues from the b-structure.

Still, if anyone have some better solution I'd highly appreciate it!

Regards, David

David Nyqvist
  • 51
  • 1
  • 8