|

Add Onclick Event To Elementor Button (Tutorial)

How To Add Onclick Event To Elementor Button

How to Track โ€œButton onClickโ€ Event (for Facebook Pixel, Google Analytics or Google Tag Manager)

If you’re running ads on Facebook (Meta) Ads, then you may be interested in adding an onclick event to your buttons in Elementor to track your conversions, sales, and leads.

To do that, follow these steps:


Follow these steps to track button onClick events:

  • Edit Button > Advanced > set CSS ID = My_Button
  • Add an HTML widget to the page (after the button will be fine)
  • Paste the following code into the HTML Code field:
<script>
document.addEventListener("DOMContentLoaded", function(event) {
  jQuery('#My_Button a').click(function(){
  // tracking code here
  // for example Facebook Pixel:
    fbq('track','AddToCart');
  });
});
</script>

Add the following CSS to your sites custom CSS region. This may be in your Theme Customizer, Site Settings, Custom Code, or child theme.

Elementor
4.5

Elementor is an amazing website builder plugin for WordPress. Elementor makes it easy to create beautiful and high converting websites yourself without having to learn code.

Pros:
  • 100% Flexible
  • No Coding Necessary
  • Thousands of Pre-Built Templates
Cons:
  • Wordpress Only
We earn a commission if you make a purchase, at no additional cost to you.

The Nomad Brad
Add Onclick Event To Elementor Button (Tutorial) 4

๐Ÿ‘‡Resources To Supercharge Your Marketing


๐Ÿ† How I’ve Been Earning Consistent Passive Monthly Commissionsโ€‹

๐Ÿ‘†Get The #1 Affiliate Training For 2022 ๐Ÿ‘†


๐Ÿš€ Best Affiliate Tools & Resources | <<< My Favorite Affiliate Resources

๐Ÿ”„.120 Top Recurring Affiliate Programs | <<< Download Free PDF

๐Ÿ“บ Check Out My Latest Youtube Video | <<< Good Stuff

๐Ÿ“ฒ Want 1-on1 Help With Your Business? | <<< Book A Coaching Call

๐Ÿ”ฅ Ready To Get Traffic With Bing? | <<< (Yes, It’s Still Working In 2022)

๐Ÿงฐ Digital Marketing Tools & Resources | <<< Speed Up Results With These

โœ… “Gamify” Your Productivity <<< Free Tool To Gamify Productivity

๐Ÿ“†ย Download My Commission Trackerย |ย <<<ย Track Commissions. Stay Motivated!

๐Ÿค– AI Tool I Use To Write SEO Articles | <<< Create Ranking Content On Autopilot

โš™๏ธ WP Plugin That Builds SEO Sites For You | <<< Create “Assets” On Autopilot

๐Ÿ‘‘ Good Course For Newbie Affiliates | Start With Free Traffic & Build Up

๐Ÿ“˜ Affiliate Book For Just $1 | <<< How To Get Started With Affiliate Marketing

Similar Posts