Hey, how can I add a JS code for an optin field to my page? Sorry, but I’m not the biggest technician.
Thanks for asking.
To add JS code to a page, you can take a look at following thread.
Sorry, but I think you did not understand that. I would like to insert an optin form on my landing page. I already have a header / footer manager. Thanks; o)
To insert a JS code to a page, edit your page in Cornerstone then add your script in Cornerstone’s JS section (see screenshot)
Make sure you don’t include the
<script></script> tags in the code. Hope this helps!
No it’s not working.
This is the code to insert.
BUT there is no “>” after the first “<script”
I put it in the JS section as you wrote and now?
where and how can I place it on my side so that the optin field is visible
So basically you’ve a script source. To include that in your site, add the following code in your child theme’s functions.php file:
Let us know how this goes!
No, is not working. or am I doing something wrong?
The code provided by Nabeel works, I’ve tested it. But since that is a form, yes you need that to be on the content.
Please paste your code on a Content Area element.
I’ve tested that on my dev and it works, it won’t show a preview in Cornerstone, but it will render on the front end.
if it does not work on your end, please do a test for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.
ok, did I understand that correctly? I’ll just pack the code into a content area element and then it will work for you. Right? I do not have to enter any additional code. Right?
If it does not work then it’s because of a plugin. Right?
Because it does not work if I just put the code in a content area element. I’ve just tried that.
Yes, that is correct:
If it does not work on your end, likely there is a plugin or another script that causing a conflict.
If you have a caching plugin, please clear it as well.
ok, i will test it tomorrow. Now I have to sleep.
I have now disabled ALL plugins except for Cornerstone. The result … it does not work!
I also emptied the cache.
Maybe you have an idea.
But now I’m really going to bed.
If you’re still up, please provide us the site URL and a login credential in a secure note so we can take a closer look while you’re sleeping.
Have a good night,
It looks like your site has security that blocks the loading of any URL not related to your site. There is 100 errors related to that and displayed on browser console.
VM2106:1 A parser-blocking, cross site (i.e. different eTLD+1) script, https://app.getresponse.com/view_webform_v2.js?u=Srsk&webforms_id=SQmP1, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
Perhaps it’s your hosting security? Especially if you’re in country with strict law about privacy? I tried it outside the builder and the theme and it’s still the same, the code won’t work since it’s blocked. I recommend contacting your hosting provider.
Ok, i will contact my provider.
First of all thank you for your help
Let us know how it goes!
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.