Problems setting up experiment on page that uses session id
I am having a problem with one of my experiments, and it seems that it's due to the fact that the page I am testing is adding a unique session id to each visit.
The page is located at
I am only able to get a match usign the match validator if I remove the query and use http://minside.adressa.no/registrering.
The problem is that if you visit that URL you get to an error page. For that reason the experiment is not tracking the visits. I have tried askin support for help on this, but I am not getting any good feedback so hoping for the community to give me some guidence :-)
Solved! Go to Solution.
Target your page using the "substring" targeting method. Substring matches against the string that you place in the targeting text input field, and then also accounts for anything that may be surrounding that string (thus the term substring).
You're trying to run an experiment on all the product pages on an e-commerce site, and the URL that you put into the editor when setting up the experiment was:
Well, the "pn" query string will be different for every product (and there might be other query strings added due to other factors), so you can't exactly match against that full URL. Fortunately, all of the product pages have the same base page of:
Thus, you would set the targeting of this theoretical experiment to something like:
and then targeting method of "substring". This means that any URLs that contain "acmewidgets.com/product.aspx" within them will be a valid targeting match.
For your example specifically, you could use something like:
That should account for the randomized query string presence and value.
When using substring targeting, I usually remove the http://www from the string that I am targeting, so that the targeting logic will account for possible URL variations that may or may not contain that structure; ie. if a page can both be secure and unsecure (http vs https) and with/without the www.
MJBeisch's advice is top-notch.
Another option if your experiment is running only on http://minside.adressa.no/registrering (plus any query parameters which are appended) would be to set up the targeting conditions for a simple match of the URL.
Simple match will match the URL, ignoring any query or hash parameters which follow it.
Further examples of how simple match (and all other match types) can be found at the following URL: https://help.optimizely.com/hc/en-us/articles/200040835-URL-Targeting-Choose-where-your-experiment-r...
Hope this helps!
Thanks for the reply @MJBeisch and @Kathryn! I really appreciate your thorough feedback!
I have tried this. The problem however is that if you visit http://minside.adressa.no/registrering you will see that you get an error message (perhaps your Norwegian is a bit rusty, but it is really an error message, hehe).
For you to visit the page you have to use the following URL
When you visit the page you will get assigned a unique session id.
Still hoping for a solution. Any ideas?
My thought is that your experiment is not counting visitors because the Optimizely snippet is not seen on all the pages. I would guess that making the script visible when they hit http://minside.adressa.no/registrering?aviskode=ADR before the redirect happens will solve your problem with counting visitors correctly.
Can you try that and report back to us what you find?
Thanks for the reply, Dodiet.
The thing is that there is not actual redirect. The page simply assigns a unique session id. In other words the visitor never leaves the page http://minside.adressa.no/registrering?aviskode=ADR.
The original targeting settings were aimed at http://minside.adressa.no/registrering?aviskode=ADR. When the session ID was inserted between the URL and the query parameter, this broke the match conditions.
Whilst a regular expression could be used to create a match condition, the easiest option here would be to target a substring of minside.adressa.no/registrering
Sorry for the late reply. I updated the settings last week and it seems to work.
Thank you for the solution and awesome help Kathryn! I really appreciate this!