Comments on: Add a jQuery Function to Google Tag Manager https://mixedanalytics.com/blog/add-jquery-function-to-google-tag-manager/ APIs, Sheets, and Analytics Thu, 25 Feb 2021 08:46:21 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Valdir https://mixedanalytics.com/blog/add-jquery-function-to-google-tag-manager/#comment-22346 Wed, 03 Feb 2021 19:50:45 +0000 http://mixedanalytics.com/blog/?p=62#comment-22346 Thanks so much for this guide, I could implement it knowing almost nothing of JS. The best part: it worked on the first try! Awesome, great job

]]>
By: Demuth Flake https://mixedanalytics.com/blog/add-jquery-function-to-google-tag-manager/#comment-17963 Thu, 09 Jul 2020 13:48:25 +0000 http://mixedanalytics.com/blog/?p=62#comment-17963 Thanks for the post. Very helpful!!

]]>
By: Ana https://mixedanalytics.com/blog/add-jquery-function-to-google-tag-manager/#comment-15070 Sat, 28 Mar 2020 15:09:33 +0000 http://mixedanalytics.com/blog/?p=62#comment-15070 In reply to Tidyzilla.

Hi there, I think that might not be the right way to apply the not(.active) selector but I don't know for sure. Regrettably I'm not particularly a jquery expert. Maybe you can try asking this question on Stack Overflow? 

]]>
By: Tidyzilla https://mixedanalytics.com/blog/add-jquery-function-to-google-tag-manager/#comment-15067 Sat, 28 Mar 2020 12:40:23 +0000 http://mixedanalytics.com/blog/?p=62#comment-15067 Hi, thanks for your tutorial.
I'm using it for the same scenario (a FAQ, where the users can click on the question or on the triangle to open the answer).
I'm trying to go a bit further, by firing the custom event only when they click to open the question, not when they click to close the question.

I have a dynamic class ".active" that is added on the parent container of the question/answer when the question is open.

I'm trying to use the css selector :not(...), but it doesn't work and I don't understand why? Do you have any idea?

jQuery("#faq-section > div:not(.active) > div").on('click', function(e) {
dataLayer.push({
event: 'faqTextEvent',
faqText: ($(this).find(".faqTitle").html())
});
});

]]>
By: Nacef https://mixedanalytics.com/blog/add-jquery-function-to-google-tag-manager/#comment-1950 Sat, 03 Feb 2018 22:06:07 +0000 http://mixedanalytics.com/blog/?p=62#comment-1950 Great work
Thank you for your time

]]>