Solved

Defining Multiple CTAs

  • 3 January 2023
  • 5 replies
  • 92 views

Badge +1

Hey, how are you?

 

I’m trying to use Visual Labelling on my site https://buildbuddy.co/.

 

I have a CTA button on multiple pages, each with different styling and wording but linking to the same page. I want all clicks on those button to be defined as the same event. I’ve tried adding the same class to all the buttons but it doesn’t seem to work.

 

Even the buttons with the same text doesn’t seem to work. Could it be because I am using WordPress > Elementor, and it adds a whole bunch of different unique classes and IDs to each button?

icon

Best answer by danielle 6 January 2023, 22:33

View original

5 replies

Userlevel 3
Badge +1

Hi @theLadEli,

 

Thanks for reaching out about this! Visual Labelling will automatically attempt to use the most specific selector for an element on the page. Since WordPress is adding unique classes and IDs to the buttons, it is likely that these will be selected. Since all of these buttons are leading to the same place, one option would be to define the events manually using the href attribute (the attribute containing the link to the registration site). This would mean creating a click event with a selector like this:

[href="https://buildbuddy.co/XXX"]

Don’t hesitate to let us know if you have any additional questions!

 

Best,

Danielle

Badge +1

Hi @danielle , thanks so much for helping.

 

So I’m on Heap, creating a definition. What do I select for Event Types and do I add any Filters or Snapshots?

 

And in the CSS Selector, do I just put in this (changing the link for the URL the buttons take you):

[href="https://app.buildbuddy.co/login”]
Userlevel 3
Badge +1

Hi @theLadEli,

 

You’re welcome! Since you’re looking for a click on a CTA button, we’ll want to use the Click on Event Type and then enter the selector for the CTA link:

If you’re hoping to capture clicks on this link everywhere on your site, then there won’t be a need to add filters. However, if you’d like to limit the event to only certain clicks on this link then you can add a filter to do so. For example, if you’d like to only count clicks on this link on a specific page, you could add a filter for a specific path or if you’d like to only count clicks on this link with specific wording, then you could add a filter for specific target text.

 

As for Snapshots, once you’ve defined the event, I encourage exploring the autocaptured properties associated with the event. It is quite possible that everything you need for analyzing these events is already captured in these properties. If you realize there is additional metadata that would be helpful in analyzing these events, then you may decide to add a Snapshot to capture this information. More information on Snapshots can be found in our documentation here.

 

Let me know if you have any lingering questions!


Best,

Danielle

Badge +1

Thanks so much, @danielle . The definition seems to be set up, but for some reason, it shows 0 Occurrences.

 

The CTA’s have definitely been getting clicks and the URL is the correct one. Why is this?

Userlevel 3
Badge +1

Hi @theLadEli,

 

In looking into this, it looks like the second set of quotes are curly quotes instead of straight quotes. Would you be able to replace the second set of quotes to see if that starts capturing clicks on the CTA links?

 

Best,

Danielle

Reply