ABTesting / KPI error in CMS 12 - Method Not Allowed (405)

Vote:
 

Greetings,

I installed the package "EPiServer.Marketing.Testing" version 3.1.1 on an Optimizely 12 site (.net 6, cms version 12.18.x), and I am having issues running an AB test.

I verified the dependencies were included. I went to a page on the site, made a change, and selected "A/B Test Changes" from the Publish Changes dropdown in the CMS.

I added one conversion goal, a default goal called "Time on page", and set this to 10 seconds with a test goal note. When clicking "Start test", the conversion goal's "Add a goal" dropdown displays an error: Method Not Allowed. This error appears regardless of if I made a conversion goal or not (this is happening locally, and on our dev enviroment).

I opened the developer console, and I can see the XHR POST error (error 405). Looking into the error messages, an object is displayed saying: message: "Unable to load /EPiServer/EPiServer.Marketing.Testing/Stores/KpiStore/KpiFormData status: 405":

XML Parsing Error: no root element found
Location: https://localhost:44310/EPiServer/EPiServer.Marketing.Testing/Stores/KpiStore/KpiFormData
Line Number 1, Column 1: KpiFormData:1:1
Object { message: "Unable to load /EPiServer/EPiServer.Marketing.Testing/Stores/KpiStore/KpiFormData status: 405", stack: "_317@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:78148\n_4f2@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:133806\n_4fe@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:134085\nEventListener.handleEvent*_4f8@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:134369\nxhr@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:135460\ndojo/_base/xhr/</dojo.xhr@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:124996\n_sendRequest@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:345594\nepi/shell/request/Extender/</xhr/<@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:345194\ndojo/_base/lang/</hitch/<@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:30941\n_2f2@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:75372\ndojo/Deferred/</_2f1/_2ff.then@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:77266\nxhr@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:345144\nxhr@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:344668\nxhr@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:343156\nput@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:335900\ncreateKpi@https://localhost:44310/EPiServer/EPiServer.Marketing.Testing/3.1.1/ClientResources/viewmodels/KpiViewModel.js:44:31\n_onStartButtonClick@https://localhost:44310/EPiServer/EPiServer.Marketing.Testing/3.1.1/ClientResources/views/AddTestView.js:561:31\ndojo/_base/lang/</hitch/<@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:30871\n_264@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:56446\n_onClick@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:133123\n_19e@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:39736\n_onClick@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:132040\ndojo/_base/lang/</hitch/<@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:30871\ndijit/a11yclick/</</_d5<@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:23972\nEventListener.handleEvent*_1f9@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:49665\ndojo/on/</on.parse@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:49186\non@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:48449\ndijit/a11yclick/</<@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:23941\ndojo/on/</on.parse@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:48920\non@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:48449\n_1cf@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:45041\nconnect@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:47046\nadvice@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:56626\ndojo/aspect/</_254/_25b<@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:55368\ndijit/_Widget/</_3c/<@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:9976\nadvice@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:55494\n_264@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:56334\nconnect@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:20986\n_19e@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:39736\nconnect@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:22919\n_attachTemplateNodes@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:69417\nbuildRendering@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:68222\ncreate@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:15421\n_19e@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:39736\ncreate@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:90490\npostscript@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:14862\ndojo/_base/declare/</_1b6/<@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:41540\nconstruct@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:53304\ndojo/parser/</_instantiate/_1af<@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:49601\nmap@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:33731\n_instantiate@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:49443\ndojo/parser/</parse/p<@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/epi/shell/widgets.js:2:57217\n_2f2@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:75372\ndojo/Deferred/</_2f1/_2ff.then@https://localhost:44310/EPiServer/Shell/12.18.0/ClientResources/dojo/dojo.js:15:77266\n", response: {…}, status: 405, responseText: "", xhr: XMLHttpRequest }
epi.js:2:44507

In my startup.cs file, I made sure to add the AB testing package:

services.AddABTesting(_configuration.GetConnectionString("EPiServerDB"));

Has anyone else ran into this issue when trying to add this package to an Optimizely 12 site?

I have reached out to support regarding this issue, and found that this package is no longer supported, and is open source.

https://world.optimizely.com/blogs/kevin-shea/dates/2022/8/the-ab-testing-addon-for-optimizely-cms-is-now-open-source/

#305985
Edited, Jul 31, 2023 16:13
Vote:
 

It has indeed been open-sourced and community-supported.

Do you have a custom CORS configuration on your site? Cause often when a POST request to a POST-only endpoint returns 405, CORS turns out to be the issue.

#305988
Jul 31, 2023 17:31
Vote:
 

We do not have a custom CORS configuration. This issue was fixed with package upgrade: "EPiServer.Marketing.Testing" version 3.1.1 to version 3.1.2.

https://github.com/episerver/content-ab-testing/issues/30

#308146
Edited, Sep 07, 2023 21:27
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.