Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1239827

    Hi there,

    We’re trying to get some events set up in Google Analytics to track clicks. The code involves adding the following onclick= within the <a href string:

    Download Our Brochure

    The clicks we would like to track are buttons within the main nav and also buttons on the homepage and elsewhere within the site. How can we add this onclick= code when we’re using Enfold buttons and main nav links?

    #1241147

    Hey jaimemerz,

    Thank you for the inquiry.

    You can attach a click event listener to the menu items and execute the Google Analytics function or tracker when someone click on the element. If you’re using jQuery, the script might look something like this.

    $(".menu-item').click(function(){
      // GA tracker here
    }); 
    

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.