Analytics
2.5K members online now
2.5K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Goal for clicking on element?

Follower ✭ ✭ ✭
# 1
Follower ✭ ✭ ✭

I have a various buttons in my website's template. each page can have different buttons, that user can click.

I want to be able to tell on which buttons users are clicking, and analyse it on page level.

This is not a page view as users do not go to a new page. So I guess I need to setup a custom event.

But I Can't figure how, the interface is not user friendly and doesn't provide any details.

 

I tried setting goal type: event

Then I am asked to fill details, like category, action, label, value. these fields are meaningless to me. no clue what to fill there and why are they necessary for my needs.

 

 

1 Expert replyverified_user

Re: Goal for clicking on element?

Top Contributor
# 2
Top Contributor

Hi Jay,

 

Before setting up your event based goal you need to send the event to google analytics from your website when the event occurs. For example you'd send an event to GA on a button click like this:

 

 <button onclick="ga('send', 'event', 'Button', 'clicked', 'Download');" type="button">Download</button> 

In my example the category is "Button", action is "clicked" and the label is "Download"

 

Then based on these details you can set up the goal in GA.

 

https://developers.google.com/analytics/devguides/collection/analyticsjs/events

 

Let me know if you have questions.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Goal for clicking on element?

Follower ✭ ✭ ✭
# 3
Follower ✭ ✭ ✭

Alright, so I actually define it in my own code first?

 

Then what is the difference between the parameters?

For example, why Button is "category", and not "label"? and why download is "label" and not "category"?

And what about the "value field"?

And should I choose "equal to" or "starts with" or "general expression"?

 

What would it look like in the interface when I view the analytic?

 

What will be best practice for me, if each button has a different name that is assigned to it with PHP? should I include the same PHP code in the GA line you suggested? 

 

For example, my buttons are generated by a While loop for like this:

 

<form action="/navigation/<?php echo $link[$i] ?>/<?php echo $name[$i]; ?> .... </form>

Where "i" can be different numbers, every number is different button.

So if I Want to know which buttons were clicked (by page basis), should I code it like this:

 

<button onclick="ga('send', 'event', '<?php echo $link[$i] ?>/<?php echo $name[$i]; ?>', 'clicked', 'Download');" type="button">Download</button> 

Or perhaps I should insert it as "value"?

 

Btw, Are Google Tags relevant at all?

 

Thanks

 

 

Re: Goal for clicking on element?

Top Contributor
# 4
Top Contributor
Hi,

Yes, you define the parameters in your code. Label and Value are not required, only Category and Action.
Category is usually used for identifying the object that was interacted with, like button or video for eg.
Action ised used to identify the type of the interaction, like click, play...
Label is useful for categorizing the events, you can add the link here in your case.

If you want to set up goals for every button separately you need to use "equal to" or if you want to track them as a single goal then you need to set up a regular expression.

To see what button was clicked on which page you can use the Behavior -> Events -> Top Events report, select Event Label as the primary dimension and "page" as the secondary.

Let me know if you have more questions.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Goal for clicking on element?

Follower ✭ ✭ ✭
# 5
Follower ✭ ✭ ✭
Hi, thanks but I still didn't get it.

What does equal to means? that the exact string in the code must fit the label I am naming the goal?
So does begins with means that a multiple number of string can fit the label? and when I will view stats, I will see the individual label names from the code?

What if my Label doesn't have any pattern?

Re: Goal for clicking on element?

Top Contributor
# 6
Top Contributor
Hi Jay,

You can read about the different match types here: https://support.google.com/analytics/answer/1116091?hl=en#matchTypes

Yes, you will see the individual label names in the reports.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Goal for clicking on element?

Follower ✭ ✭ ✭
# 7
Follower ✭ ✭ ✭
Thank Arnold, I think I'm starting to get it now Smiley Happy

In Analytics, I only set up "Category" equal to "button" and "Action" equal to "click".
In the code, I added a different value for each button, So I can now view the stats either by category (such as Button from Type A vs B), or by specific button destination (which is the value).

How can I see a breakdown that shows me a list of all pages, with a column that says what is the percentage of people who completed the event vs. total number of unique visitors?
I went to Events > Pages, but it doesn't show any stats about the total number of unique visitors.

Also, what is the difference between an event and conversion? conversion are based on events, aren't there? so why do they have separate menus?

Re: Goal for clicking on element?

Top Contributor
# 8
Top Contributor
Hi Jay,

You can set up a custom report, select Page as dimension and Users and your goal completion as the metrics.

https://support.google.com/analytics/answer/1151300?hl=en

You can track any user interaction as an event on your site for stats. You don't want to track all of them as goals, only the important ones like form completions or downloads. GA allows to set up the goals based on the events.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Goal for clicking on element?

Follower ✭ ✭ ✭
# 9
Follower ✭ ✭ ✭

So for tracking an event, I only need to implement the html code, without doing any additional action on the GA interface end?

 

I've tried making this custom report, but something doesn't work as expected:

First, I have several goals, for example, I have some kind of funnel - If user clicks on Button A, he would then Be shown with Button B. So I want to see, for each page, the number and percentage of people that clicked on button A, and the number and percentage of people who clicked on button B later, out of the total users that entered the page.
Therefore using "goal completion" would be too general, as it would include all possible goals wouldn't it?

 

Anyway, I've tried using Goal completions and this is what I see:

 

goals.png

 

Goals are showing as "0", both for total , and for each page. But you can see that it also says in indicates "25" goals in brackets. 

What are these brackets? I Believe these 25 should be instead of 0. What is not set up right here?

 

Re: Goal for clicking on element?

Follower ✭ ✭ ✭
# 10
Follower ✭ ✭ ✭
*BUMP* - can anyone help?