I'm keen to utilise the new integration with Conte...
# ask-questions
h
I'm keen to utilise the new integration with Contentful I wasn't clear on how to follow this part of the documentation so some more clarity/screenshots there might put me on the right course please @strong-mouse-55694 > Add or update your content model Create a new content model or update an existing one to include the GrowthBook Experiment content type. This content type will allow you to create and manage experiments directly within Contentful. Thanks
w
Hi Joe. That doc clearly has some formatting issues. Thanks for pointing that out. I think it could also be clearer pointing out that Growthbook Experiment content type should be included on a pages via a reference field. So you need to go to your content models and make sure they have a reference field or a reference many field in the place where you want to run an experiment.
Some reference fields you already have might have "Accept only specified entry type" set. If that is then you should make sure "Growthbook Experiment" is one of those types.
h
Thanks James I'm getting an error when I try to set up the experiment - which looks like a 400 error from the cdn.growthbook.io api. I checked my config and it looks ok How should I debug that?
w
Sorry about that. That's not a very helpful error message is it. I'll look into it and get back to you ASAP.
Oh I see, you put in cdn.growthbook.io as the api server. That should be api.growthbook.io, the default most probably. The cdn serves the features to users of your site, but contentful need to connect directly to api.growthbook.io in order to set up the experiments.
h
Thanks James. I tried the other other API endpoint and I'm having the same problem. Within this content type, I have picked an existing field ('product') which is a reference, and added
Growthbook experiment
to the valid entry types. I get the error as soon as I go to make a new item using this content type. Even before I've selected to build a growthbook experiment.
I've taken the API key from the API section of Growthbook and pasted it into the app config settings in contentful. It starts
secret_admin_***
w
Hi Joe, sorry that you have a new issue. It's a bit hard to know exactly what is going on here. My guess is the entry is in some error state that the plugin hasn't been coded for. Now that the API server URL is correct, I'd imagine that perhaps if you created a new Growthbook Experiment from scratch it might work. Can you see if you can reproduce this problem on a brand new experiment?
h
I don't even get as far as creating an experiment. The error happens as soon as I go to make a new product.
w
If you go back to the main "content" list from the top menu. Then click "Add Entry" and click "Growthbook Experiment", then make a new experiment name and add two variations, and click Create Experiment, does that work now?
👀 1
In terms of the original error message you were seeing when you had put in "cdn.growthbook.io" as the server URL, I have added a PR to Contentful to have a better error message. It should be better for the next release. Thanks for reaching out so we could make the Plugin better!
👍 1
h
No luck.
I've also tried adding it to a fresh content item, but I hit the same problem when I click 'create new experiment'
w
Hi Joe. The "Growthbook experiment" sidebar should not be showing on the "Super hero" content type. The installation of the Growthbook plugin only adds it as a sidebar widget on "Growthbook Experiment" content model. Did you add it manually to the sidebar? If so you can remove it.
Afterwards you can click on the Add Content on the Super Hero page for product and you should be able to create a new Growthbook Experiment Entry. You should then be able to click on that new entry and create the experiment name, add the two product variations that you want, and then click the "Create Experiment" button in the sidebar.
h
Sorry James, still no luck 😕
w
I have added a warning now if the Growthbook Experiment is loaded in the wrong content type: https://github.com/contentful/marketplace-partner-apps/pull/4366
It looks like again the "Growthbook server url" in the configuration settings might have changed.
Or hmm there is a 4d...ctf.cloud.net/jL...fg/ before the actual url.
I'm not sure what is adding that. Is that something specific to your Contentful setup?
h
I haven't changed the setup from this
w
yeah it has the correct url there at the end, but something is inserting stuff before hand. Perhaps there is a site wide proxy setting or such.
Do you happen to know if you have something like that?
ah... the server url should be a complete url:
<https://api.growthbook.io>
since you didn't have the https:// it added it to your current contentful space url.
h
ok we are a step forward 🙂 it'd be helpful update this to reflect the full url
but I'm now getting a different error 😕
w
it'd be helpful update this to reflect the full url
Yes I have a PR that is half written that does that and some other extra validation on the configuration page.
but I'm now getting a different error 😕
Oh no. That one might not be so fixable without getting the code updated. The plugin right now assumes that query_id which I assume your datasource on growthbook doesn't have. I can see if I can load the available query_id's from the datasource api and/or add it to the configuration page, but unless you change the query_id on your datasource in growthbook I'm afraid the plugin won't work as is.
Sorry for all the rough edges on the plugin. I believe you may be one of our first real users of the plugin. I unfortunately can't make changes to the plugin anymore today, but will try to get the change in tomorrow. I believe I can update the plugin without Contentful approving, but I'm not sure. I'll let you know when this is fixed.
Have a good night/day wherever you are.
h
Thanks James! Appreciate your partnership!
w
Likewise.
h
Hey @white-fireman-22476; wondered if you'd managed to make the fix please?
g
@white-fireman-22476 Hi James, I’m Andrés, I’m an engineer with TodayTix, picking up some of the work that Joe has been doing with you. I have run in the same error Joe run into when trying to publish a
Growthbook Experiment
entry. It renders the following error:
Copy code
Unrecognized assignment query ID: user_id
I checked the API call that is being done to GB, it is POSTing an entry to the
experiments
endpoint, with the following payload:
Copy code
{
  "datasourceId": "REDACTED",
  "assignmentQueryId": "user_id",
  "trackingKey": "andres-contenful-test",
  "name": "andres contenful test",
  "variations": [
    {
      "name": "Control",
      "key": "0",
      "id": "4ajdZxDD1jcEuAezXyLDS0"
    },
    {
      "name": "Variation A",
      "key": "1",
      "id": "4zusFvHuVtpYLUkfBKFb6s"
    }
  ],
  "description": "Created from [Contentful](<https://app.contentful.com/spaces/REDACTED/entries/2JcbY9T7Jjkyy1iXJMdYUG>).  \n\n#### Variations  \n**Control**: Gypsy Takeover  \n**Variation A**: WL Musicals Banner hamilton\n        "
}
The endpoint returns a 400 error, with the rendered message.
user_id
does exists in our data source. Would that information help you troubleshoot what might be going wrong with our experiment? Thanks in advance for your help. cc @hundreds-midnight-51493
👍 1
Circling back, are there any updates on the Contentful integration with GB @white-fireman-22476?