JS query / lightbox not working

Hi X Team,

I’m having problems with my JS Query and lightbox. It often doesn’t respond. Sometimes is does respond but mostly not. I get a lot complains from customers about it. Can it be browser related (I use Chrome on Win 10 pc) or is there something wrong with how the module is integrated into the website?

If I test it myself it’s also not responding. When I manually change the size of my browser window to get the Hamburger Menu then it works. What’s also strange is that when I’m in full size browser windows the JS Query and lightbox isn’t responding in the Header but it works in the Footer??

See Secure Note

Thank you

Hi @smart_x,

I wonder if you are talking about the LightBox shortcode of our theme? If not you are talking about a code that you added? If that is the case, unfortunately, it is outside of our support scope as it is a customization request.

But if you are talking about our Lightbox shortcode please kindly give us more details on how you added the shortcode and which page to look into and we will follow up.

Meanwhile, I suggest that you use the Content Area Modal element to have a lightbox feature or if you are interested, you can use the ConvertPlus plugin.

Thank you.

Hi X Team, @ruenel

Can you Please have a look at it again. You have helped me before with this.
Thank you.

See secure note

@ruenel

I spoke to somebody and he said the following. See Secure Note

Hi @smart_x,

The book lightbox is actually working fine on my end, even on IE11, please try clearing your browser cache or use the Incognito or private mode of your browser where there is no caching and browser add-ons involve.

Thanks,

HI X Team @friech @ruenel

Unfortunately it’s not the cache. I have tried several browsers (Chrome - IE - Brave) in both normal and incognito mode. The problem is that it works sometimes but then it stops. I know it’s not only at my end because the complain comes from external users (customers).

It might work in a new windows then you click on an different part of the website and then the JS query stops working, no response at all.

Did you see the comment in my last Secure Note?

Please help me solve this. Thank you.

Hi @smart_x,

You’re right, the issue is very inconsistent sometimes you get it sometimes it’s not. here’s the error


It has something to do with Google Analytics? How did you add the Google Tag Manager code? Can you restore the original code for lightbox only? No ga() function.

Follow the article below, it might help.

Thanks,

Hi X Team,

Thank you for this information. But I have no clue where to start. In the link to Timonweb (https://timonweb.com/posts/fixing-uncaught-referenceerror-ga-is-not-defined/) they advice a few options to troubleshoot.

Which one would you advice to solve my error. I must say that I have no clue and would really appreciate you guidance and help it this matter.

I need to solve this quickly because I get more and more complains about this matter.

Hi X Team,

Can I Just add this https://www.google-analytics.com/analytics.js to the code and that might solve the problem? I have no clue on this problem.

jQuery(document).ready(function($) {
$("#menu-item-3039 a").on(‘click touchend’, function(event) {
https://www.google-analytics.com/analytics.js ga(‘send’, ‘event’, ‘Button’, ‘Click’, ‘Open Lightbox’);
});
});

I tried to delete this code under

Theme Options > JS:

jQuery(document).ready(function($) {
$("#menu-item-3039 a").on(‘click touchend’, function(event) {
ga(‘send’, ‘event’, ‘Button’, ‘Click’, ‘Open Lightbox’);
});
});

Unfortunately that doesn’t resolve the problem :disappointed:

Hi @smart_x,

Based on the error message you are getting which is ga is not defined, it means that the main analytics file where the ga function is in is not present causing the error. Normally, adding the main analytics file then calling the ga function should be fine. But based on the previous thread you have posted you are using some plugins that adds the analytics file.

This kind of matter is hard for us to trace because there are custom codes involved from third parties and we do not know how much custom codes there is on your site you have now.

I would like to reference back to the previous threads you have posted 1 2 regarding this. Please note that this implementation involved quite a lot of customizations. As mentioned in some threads, we cannot provide support for custom scripts or implementation due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script.

At this point, it would be best to get in touch with a developer if you do not know where to proceed so that they will be able to investigate your site and trace back what is causing the issue.

Thank you for understanding.

Urgent see secure note

Please respond that you have read previous Secure Note

@jade
Urgent…see previous posts

Hi @smart_x,

I have removed the links on the previous replies and moved them to the secure notes for reference and it will only be visible to you and the staff.

Thank you.

@jade

Thank you very much

You are most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.