I’ve been looking for a solution to display a mailchimp popup to appear when a elementor video ends or during the video after soecific time. Any ideas how can I achieve this?
Thanks
I’ve looked for many plugins but can’t find the right one.
I’ve been looking for a solution to display a mailchimp popup to appear when a elementor video ends or during the video after soecific time. Any ideas how can I achieve this?
Thanks
I’ve looked for many plugins but can’t find the right one.
2
Answers
ok can you check, if it was supposed to be like this? Because the mailchimp is only working when I put the code in the header.
var vid = document.getElementById("myVideo"); vid.ontimeupdate = function() { if(vid.currentTime >=10) { id="mcjs">!function(c,h,i,m,p){m=c.createElement(h),p=c.getElementsByTagName(h)[0],m.async=1,m.src=i,p.parentNode.insertBefore(m,p)}(document,"script","https://chimpstatic.com/mcjs-connected/js/users/d1a3aa250e9e98fcd1a0c6ea3/d5e47d4b3f0935ab971858cf8.js"); // Add your Mailchimp popup code here... } };Totally understand that you’re hunting for the perfect solution to have a Mailchimp popup appear either during your Elementor video or right after it ends. Sometimes it feels like you’re trying to find a needle in a haystack, doesn’t it?
Well, I don’t want to leave you hanging, so here’s a workaround I came up with. It’s a little DIY, so roll up those sleeves!
First off, you’re gonna need to use a bit of JavaScript for this. Don’t worry, it’s not as scary as it sounds!
You’re going to utilize the HTML video tag’s ‘ended’ event. What this does is it triggers as soon as the video ends. Now, if you want the popup during the video, you’ll need to use the ‘timeupdate’ event instead.
Now here’s the part where Mailchimp waltzes in. You’ll need to use the Mailchimp popup embed code and modify it a bit. You know the part that says "document.addEventListener…"? You’re gonna have to replace that with your own function that gets called when the video ‘ended’ or ‘timeupdate’ event happens.
It should look something like this:
In case you want the popup to appear at a specific time, use ‘timeupdate’ event, like this:
Just remember to replace ‘YOUR_DESIRED_TIME’ with the time you want the popup to appear (in seconds).
So, there you have it! Not exactly a walk in the park, but with a bit of elbow grease, it should work like a charm!