Is there an embeddable signup form?

I see. There’s nothing on the network tab that’s even loading from my Ghost site

EDIT: Disregard, I found this

Does it literally say GHOSTADMINDOMAIN or your actual domain name?

It says my *.ghost.io domain, which I just didn’t want to post.

302 is a temporary redirect. There should be a Location header in the HTTP 302 response of the URL it will try next.

OK I found this. There’s no access-control-allow-origin here though. It seems like it’s redirecting from my admin domain to my regular domain. Could the discrepancy be why it’s throwing a CORS error?

EDIT: I figured this out. I needed to use my regular domain for data-ghost and my admin domain for data-api. This is what my script tag should have been:

<script defer src="https://unpkg.com/@tryghost/portal@latest/umd/portal.min.js" data-ghost="https://www.vallejosun.com" data-api="https://vallejo-sun.ghost.io/ghost/api/content/" data-key="699593c3a30c3a6f2376e2f14a"></script>

2 Likes

Glad you figured it out! :) Thanks for reporting back.

Adding this to the external site is now adding the “subscribe” button from the bottom right corner of my Ghost site to the other site.

Now there is a built-in solution:

1 Like

Hi all!

Does anybody get the following error in the console when trying to subscribe to an email?

api.tsx:18 
GET http://localhost:8000/members/api/integrity-token/ 404 (Not Found)

It doesn’t work on localhost, but it doesn’t work in production either…

I have a blog setup on www.mydomain.com/blog. I am trying to add the embeddable form to the homepage (www.mydomain.com). When I try to submit the form, the validation message says “Something went wrong, please try again.”

Here’s how my script and form look:

<script defer src="https://cdn.jsdelivr.net/ghost/signup-form@~0.1/umd/signup-form.min.js" data-ghost="https://mydomain.com" data-api="https://mydomain.com/blog/ghost/api/content/" data-key="19305e56ac2c1589024ad0305a" data-button-color="#d08933" data-button-text-color="#FFFFFF"></script>

I tried this too: data-ghost="https://mydomain.com"

I’ve read across the forum and couldn’t find this error message anywhere. My version of Ghost CMS is 5.76.2.

Any help is more than appreciated!

You’re on a pretty old version of ghost and may want to update.

To get a more diagnostic error message, please open the browser console (F12) and look for any error messages on the console or network responses shown in red (look at what’s in the response if you find one)

Thanks for the advice!

Here is the response of the error:

{
    "errors": [
        {
            "message": "Resource not found",
            "context": null,
            "type": "NotFoundError",
            "details": null,
            "property": null,
            "help": null,
            "code": null,
            "id": "48b79d20-8242-11ef-acc2-7f98b1a6b9d0",
            "ghostErrorCode": null
        }
    ]
}

You think that updating Ghost to a newer version would help? Is my current version really that old? I’m on the latest major version (5).

It’s not horribly old, no. But the ghost team bumps the minor version weekly, and it’s 5.96 today. It’s possible that upgrading will fix the problem.

What network call is that response to? And can you share the code that you’re using to embed the signup card?

I already shared the code that I use to embed the signup form, but here is it again. Now it’s somewhat different:

<script src="https://cdn.jsdelivr.net/ghost/signup-form@~0.1/umd/signup-form.min.js" data-button-color="#d08933" data-button-text-color="#FFFFFF" data-site="https://MYDOMAIN.com/blog" async></script>```


This was my initial version of the code. Then I tried using some advice from this thread (which was the previous version of the code I pasted earlier).

The response I pasted is the response for https://MYDOMAIN.com/blog/members/api/integrity-token/.

I noticed that when I change https://MYDOMAIN.com/blog to https://MYDOMAIN.com/ I get a CORS error like many other people in this thread. However, I didn't try pushing this change, so this CORS error appears only on localhost (so far).

Sorry! I should have scrolled up!

I think you’re maybe looking at a bug related to having Ghost in a subdirectory.

1 Like

Thank you! I’m gonna search the forum for topics that describe such bug. So basically, I should migrate the blog to a subdomain?

That’s a big step (will break all links) if your blog is in production. Before you do any of that, I’d encourage you to update to the lastest version of Ghost, because it might just make the problem go away. :) And if it doesn’t a bug report would be appropriate.

Alright, will do. Thanks a lot!

Update for anyone with a similar problem. Updating Ghost CMS to the latest version did the trick. Luckily, I didn’t have to migrate the blog to a subdomain. Thanks everyone for the help!

1 Like