Home>Support>Empty Class Parameters

Empty Class Parameters

Hi, I’m trying to track my button clicks with Google Analytics, but the Click Classes, Click Element, CLick ID, etc., are all empty parameters. How can I populate these so I have something to target?

Cheers!

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 1 month, 7 days ago Alex S Hi, I Work Here

    Hi Vu,

    Unfortunately, SiteOrigin CSS isn’t able to modify your markup so it’s not able to add classes, ids, additional elements, or onclick events. It is possible to write a selector to target a very generic element but that’s beyond the scope of the support we can offer here so I recommend adding the button using something else like the SiteOrigin Button widget (added by the SiteOrigin Widgets Bundle plugin) or a hiring a developer to assist you with this.

    We recommend using Codeable. You’ll be able to hire someone at an hourly rate to do this work for you.

    Kind regards,
    Alex

  2. 1 month, 7 days ago Vu Nguyen

    Thanks for the quick reply Alex.

    All of the buttons on my website are from the SiteOrigin Button Widget. What I’d like to do is track button clicks with Google Tag Manager, and just need unique identifier like ‘Click ID’. The only field that is populated is ‘Click Text’ which doesn’t work with Google Tag Manager.

    Thanks!

  3. 1 month, 7 days ago Alex S Hi, I Work Here

    Hi Vu Nguyen,

    You can set an id or onclick for the SiteOrigin Button link by adjusting your button settings. Please open the widget you want to assign an id/onclick for and then open the opening the Button Widget Documentation attributes and SEO settings group. Adjust the onclick and Button ID as desired. You can also use the generic class ow-button-base a or if Use Hover Effects is enabled, .ow-button-hover.

    Kind regards,
    Alex

  4. 1 month, 6 days ago Vu Nguyen

    Hi Alex,

    Yes, I’ve used the button widget and have created values for both ID and Class. Under onclick, I’ve tried: ga(“send”, “event”, “Button”, “Click”, “Buy it Now Button”, “1”);.

    On Chrome, when I use the inspect function, I can see these parameters being passed through. However, they are not passed through to Google Tag Manager.

    I’ve uploaded screenshots of both.

    https://evolutionvn.com/wp-content/uploads/2020/06/Image-1.png
    https://evolutionvn.com/wp-content/uploads/2020/06/Image-2.png

    Thanks!

  5. 1 month, 4 days ago Alex S Hi, I Work Here

    Hi Vu Nguyen,

    That’s odd. Do you have a public URL where we can take a look at the page that contains the button that has that onclick set?

    Kind regards,
    Alex

  6. 1 month, 4 days ago Vu Nguyen

    Hi Alex,

    Yes – my homepage https://evolutionVN.com contains 2 “Buy” buttons. Both have the onclick set.

    What is strange is that sometimes the properties are passed through to Google Tag Manager. I would say about 5% of the time it works.

    Best,

    Vu

  7. 1 month, 3 days ago Alex S Hi, I Work Here

    Hi Vu,

    Thanks. You’re using Google Analytics through Google Tag Manager so the ga function doesn’t exist which is why the onclick code isn’t working. Here’s the help doc on setting up an onclick while using Google Tag Manager.

    Kind regards,
    Alex

  8. 1 month, 3 days ago Vu Nguyen

    Hi Alex,

    Brilliant – it worked. Note that forward slashes were added. I removed them by replacing the single quotations with double quotations. Not sure if that’s correct but it works.

    Thanks for your help.

    Vu

  9. 1 month, 3 days ago Alex S Hi, I Work Here

    Hi Vu Nguyen,

    Great to hear that helped! :)
    Please open a new thread if anything else comes up.

    Kind regards,
    Alex

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More