Announcement

Collapse
No announcement yet.

Need some quick help with onclick tag

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need some quick help with onclick tag

    My site got selected by a group of college kids at U. of Md for an google ads project. As part of their assignment they need to track clicks on a link in our navigation on the homepage via tag manager/analytics. I can't see an easy way to do this. I guess it needs an "if then" code in the navigation set? And with students as always they need to show their work by 2pm est today! Ha.
    Here's the code that needs installing:

    <a href=" link in my store's dropdown navigation" target="_self" onClick= "gtag('event','product_category',{ 'event_category':'1950', 'event_action':'browse_category', 'event_label':'1950s men vintage clothing' })" >1950s</a>

    Can anyone help with something I can patch into the code for the navigation to get this done?

    Thanks
    greg
    ballyhoovintage.com

    #2
    Assume you are using a ReadyTheme. I think if you switch that link to URL instead product, category, page, then you can paste the entire Url into the box
    ie.

    "something.html" onClick= "gtag('event','product_category',{ 'event_category':'1950', 'event_action':'browse_category', 'event_label':'1950s men vintage clothing' })
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Unfortunately this simple solution won't work. The link had to be hard coded.

      Comment

      Working...
      X