Skip Navigation

[Resolved] Mailchimp Pop Up Form Script is breaking view

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here was that the customer wanted to apply the mailchimp popup form script to his wordpress through an example code provided from mailchimp.

<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us17.list-manage.com","uuid":"144e2b841120da1b2d05b4e05","lid":"f7f8eb5e63"}) })</script>

Solution:

We currently have no solution for this as this script was not meant to work with wordpress or wasn't made wordpress compatible because even on a clean installation with non of our plugins the issue was still present where the script was generating errors in the console.

The alternative is to use the embedded form or a mailchimp form plugin to have your subscription form.

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 27 replies, has 2 voices.

Last updated by Nicholas 6 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#607999

Hello I am trying to implement the new Mailchimp Pop Up Forms feature on my site like so:

<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us17.list-manage.com","uuid":"144e2b841120da1b2d05b4e05","lid":"f7f8eb5e63"}) })</script>

add_action('wp_footer', 'your_function_name');
function your_function_name(){
?>
<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us17.list-manage.com","uuid":"144e2b841120da1b2d05b4e05","lid":"f7f8eb5e63"}) })</script>
<?php
};

However these scripts generated from mailchimp break my view

Uncaught ReferenceError: Backbone is not defined
at utils.js:11
wp-playlist.min.js:1 Uncaught ReferenceError: Backbone is not defined
at wp-playlist.min.js:1
layouts-loader.js?ver=1.3.5:6 Uncaught TypeError: Cannot read property 'Utils' of undefined
at Object.DDLayout.ThemeIntegrations.LayoutsLoader (layouts-loader.js?ver=1.3.5:6)
at HTMLDocument.<anonymous> (layouts-loader.js?ver=1.3.5:80)
at i (jquery.js?ver=1.12.4:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
at Function.ready (jquery.js?ver=1.12.4:2)
at HTMLDocument.K (jquery.js?ver=1.12.4:2)

Please help

hidden link

#608042

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nicholas,

Thank you for contacting our support forum.

It seems the code is throwing a JS error on the page.

Does the form from mailchimp work as intended ?

Please let me know.
Thanks,
Shane

#608171

No the form from mailchimp doesn't work either

#608172

Can you please test it on your own, to confirm this compatibility problem?

#608195

I stumbled across this: hidden link

However the layouts-loader.js?ver=1.3.5:6 file is still interfering.

#608573

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nicholas,

Would you mind providing me with admin access to the site so that I can have a look at this ? I believe the Javascript is breaking the functionality.

Could you also link me to where you inserted the code?

Thanks,
Shane

#608707

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nicholas,

I need your exact environment in order to do a proper debugging.

The other alternative is that you can provide a a duplicator package of the website so that I can have a look at it.

To do this, have a look at the link below.
https://toolset.com/faq/provide-supporters-copy-site/

Thanks,
Shane

#611869

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nicholas,

Thank you for the credentials,

I'll be taking a look at this for you.

#611880

Thank you

#611986

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nicholas,

It seems that you didn't add a username or password for your site so that I can log in.

I've enabled the field again so that you can provide them.

Thanks,
Shane

#612254

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nicholas,

Thanks it seems I got a bit confused.

However I checked on the issue and it seems that the mailchimp plugin was Not installed. I went ahead and installed this for you but the plugin requires some amount of setup in order to use the forms.

You must first create a form before we can add it to the page. To create a form please take a look at the link below.
hidden link

Thanks,
Shane

#612665

Noooo this is not what I am trying to do. Please remove this plugin.

Here's the documentation of what I am trying to do. This is a new MailChimp feature.

hidden link

hidden link

The pop-up form is created through MailChimp and I all I need to do is place this code on my page.

<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us17.list-manage.com","uuid":"144e2b841120da1b2d05b4e05","lid":"18f30240e9"}) })</script>

Please check the console on this page I sent you earlier. It's interfering with the toolset views and layout plugin.

#612907

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nicholas,

I understand what you are trying to achieve but i'm assuming that this does not work without the mailchimp plugin installed.

I also would highly recommend contacting the mailchimp support forum as we are not very familiar with how the mailchimp setup works with their popup forms but i'm assuming that the base plugin is required.

Does the popup form work when our toolset package is disabled completely ?

I'm sorry but i'm not too sure how this code works as the mailchimp doc on how to do this isn't very clear.

Looking forward to hearing from you soon.

Thanks,
Shane

#612911

Did you read through the MailChimp documentation I had sent you?

Please read through it.

And please also check the console of the page where I placed the MailChimp code.

Yes, the pop up works when toolset plugins are deactivated. You can test it for yourself but please don't install any plugins.

#612915

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nicholas,

I did read both docs that you sent.

I checked again and see that your plugins for toolset are outdated, could you update them to their latest versions.

Also do you mind if I disabled the toolset plugins and check on the site as well ?

I would like to see how the popup works and then debug the issue further. I must apologise for the misunderstandings earlier as i'm not so familiar with mailchimp.

Thanks,
Shane

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.