I’m new to coding in general so forgive me if what I have is useless.
What I want to achieve is when a user fills in their email address on my page, they are added to my active campaign account. I had this operating previously using their embedded forms but the form simply didn’t load 50% of the time so our conversion rates dropped through the floor.
I have a landing page with a text input field (email) and a submit button connected to a database & dataset.
I’ve also had a go at connecting to the Active campaign API using the wix fetch function from a web module.
My thought process was to set up a web module that stores the URL for my activecampaign api as well as the secret key and then call that function from the front end in the page code.
Here is my back end code.
My front end code
import {getApiKey} from 'backend/ACKey'
$w.onReady( function() {
getApiKey()
} );
On the preview, I’m getting the error message “Fetch did not succeed” which I believe tells me that my HTTP request is being rejected by Active campaign. But I don’t know for sure.
Any advice on how I can make this API integration work would be highly appreciated!.
Thank you