Google Analytics - show pathname in label - google-analytics

We're tracking events on our website and we've managed to implement this:
ga('send', 'event', 'Download', 'completed', 'pathName/filename');
For when a user clicks on a pdf download link. The "pathName/filename" is eg. "whitepapers/mywhitepaper.pdf"
What should I write in the Goal details:
label equals to ...?
label starts with ...?
label regular expression ...?
In a way, the question is similar to this one, with the important difference that I've implemented that part with someone's help but I don't know what do to next in the Analytics to reflect that.
Thanks!
Serge

Related

Virtual page view issues -datalayer- GTM

I'm working with this preebuild ecommerce system, all of the checkout is in an iframe. And the event below is pushed at every major step, 'checkout 1','checkout 2','payment details' and 'transaction complete' page & title reflects each steps. But NOTE the event name 'VirtualPageview' is the same for all steps mentioned above.
{
event: 'VirtualPageview',
page: '/Test/test',
title 'test | test',
gtm.uniqueEventId:25
}
Visual in gtm debugger:
https://gyazo.com/6356cc13f6b63cad73e55d10abc90154
Now i'm wondering if there is any way to track this as pageviews in analytics? (My primary goal is to create a funnel visualization)
I've read through so much information and as a beginner i'm quite overwhelmed, i would appreciate a little info to point me in the right direction.
Here is what i've done this far, not sure if i'm on the right path.
I feel limited with this setup, because the trigger will trigger on all steps because event name is the same, that would be fine if i could somehow grab page and page title from datalayer dynamically.
GTM TAG
https://gyazo.com/6f7ea35307bca9694835359485b9f74d
GTM Trigger
https://gyazo.com/4c3b489f627dd72e17816e5b5f61f299
You have to create a DataLayer variable called page and another called title (names of your variables) and use them as field values like this: {{page}}

Google Tag Manager tracking drop down menu/list (Web app built in R-Shiny)

I have a R Shiny app that I have connected to Google Analytics using Google Tag Manager (R Shiny app means AJAX website). I am currently tracking the standard stuff like PageViews, and have set up a tag to track which Tab a user clicks on (Using Click Element).
In most tabs, I have a drop-down menu/list (can be seen in the picture). When clicking on this list to select/change the input, the click element does not fire. So clicking does not work here.
In the same picture, I have included the source html code. I highlighted what I think is important. The default input is "Age Group (Discrete)." The "option value=" and "selected" changes the input (changed to "Pyramid (Discrete)"). And it also changes in the div class="item" data-value=..." line.
I do not know how to capture when a user changes the input using Google Tag Manager. I am however able to successfully track this if I put this GA code in my JavaScript file.
$(document).on('change', 'select', function(e) {
ga('send', 'event', 'widget', 'select data', $(e.currentTarget).val());
});
But the above only works if I also have this included:
ga('create', 'UA-######', 'auto');
ga('send', 'pageview');
Which means it is double-counting pageviews (tracking page-views on GTM and the GA code above).
I prefer to track what I want using just GTM. Any help would be appreciated. Let me know if the image is hard to see (May need to zoom in). Thanks
one possible solutions is using GTM custom events:
1) adjust your code to trigger custom event instead of sending GA event:
$(document).on('change', 'select', function(e) {
dataLayer.push({
'event': 'widget data selected',
'selected_value': $(e.currentTarget).val()
});
});
This will trigger specific widget data selected select that can be catched with Custom Event Trigger. Then just use that trigger for your regular Analytics Event GTM tag.
Additionally, you might set up user-defined Data Layer variable to read the selected option value from dataLayer and use it in your tag.

How to track a phone number on Google Analytics?

I have a webpage with a phone number on it.
I want to be able to track how many people are clicking on that phone number.
How can I do this, please?
Many thanks.
Use Komito Analytics. It allows you to track CTAs such as a phone number clicks. See integration page for more information.
You can track how many user clicked the link with phone number.
The sample link looks like:
<a onclick="ga('send', 'event', { eventCategory: 'call', eventAction: 'click'});" href="tel:<YOUR-PHONE-NUMBER>" title="call me">Call Me</a>
And then in Google Analytics for instance you can create a new custom goal.
Go to: Your view->Goals->New Goal
And next do following steps:
Goal setup: custom
Goal description: name (for instance "Call me button"), type: event
Goal details: Category setup as equal to "call", Action setup as equal to "click"
Save

Tracking click on an "href" image as a goal in Google Analytics

thanks in advance for the help,
I have this code on my page:
a href="https://eshops.mercadolibre.com.mx/XXX" target="_blank" onclick="__ga('send', 'event', 'button', 'click', ‘URL’);">Mercadolibre
But I cant see the results reflected on Google analytics, I created a goal called "ClickOnLink" with details as follow:
Details
What am I doing wrong?
Your goal configuration specifies a value greater than 0, but the event your onclick is sending does not have a value associated with it. Either you send a value greater than 0, or you remove the value condition in your goal.
Make sure you have the same letter casing as well.

Visitor Custom Variable Google Analytics Help

I am using Google Analytics Custom Variables for a site I am working on. Here is the code snippet uploaded on the page.
_gaq.push(['_setAccount', 'UA-xxxxxxxxx-1']);
//]]>
</script>
<script>
//<![CDATA[
_gaq.push(['_trackPageview', 'searches/new/registration/complete']);
_gaq.push(['_setCustomVar', 1, "member type", "registered", 1]);
_gaq.push(['_trackEvent', 'registration', 'signup',,1]);
Although I am aware that the _trackPageview needs to be placed after the _setCustomVar call, I am still seeing numbers flow through into Google Analytics as 'member type=registered'. I do not want to dismiss these numbers and I want to make some sense of it before I amend this error in how the snippet was placed.
Any reason why I stil received visits for this Name-Value combination?
Thanks -
The Custom Var is set with a GA cookie, and is actually stored and sent on your next _trackPageview, that's why you can still see it, all you are doing to sending the data probably in a moment you don't want to (the next pageview).
Edit: Also as pointed out, it could go with your _trackEvent method, wich will end up doing the same thing, sending the data in a particular time you dont intent to, specially with events, wich are linked to interactions, so if no one triggers those in the page you are trying to set the customVar, it wont get set at all.
Because your custom variable's scope is set to 1, it'll still get fired by "trackEvent" (even without "trackPageview".
If your scope was set to 3 (page-level), it will then rely on "trackPageview" and will not register well with "trackEvent"

Resources