How do i send clicks manually to google analytics? - javascript

I have a ToC with all the links in the format as "#id-link". I can generate the href as anything i want easily. However i dont think adding ?utm_source=... will send google analytics the click events (does it!? i was looking at How do I tag my links? at the time)
How do i send clicks to google analytics?

At any point you can send page views to Google using the TrackPageView command:
_gaq.push(['_trackPageview', '/document/sectionName.html']);
So in your ToC, for example:
Links

Related

Google calendar add event with redirect url

I'm trying to add a button to my website that will add an event to my google calendar, I found this url:
https://calendar.google.com/calendar/r/eventedit?text=Your+Event+Name&dates=20140127T224000Z/20140320T221500Z&details=For+details,+link+here:+http://www.example.com&location=Waldorf+Astoria,+301+Park+Ave+,+New+York,+NY+10022&sf=true&output=xml
which works and it's really handy to configure, but I'm wondering, because when I click on it, it takes me to google calendar and it will never come back to my site.
Is there a possibility to add a some parameter to once the event is added, make google calendar redirect to my website?
Thanks in advance.
No there is not a way to do this. Your best bet is to have this link open in a new tab/window so that the user still has your site open.
Another option is to use the Google Calendar API if you're adding a lot of events for a user and have them authenticate. This way you can just use an API to add events and keep them on the page. I would not suggest this solution if you're just adding an event here and there as it's quite invasive to give calendar access to an application.

How to get Google Tag Manager Event Tracking to send to Google Analytics?

My website has a tel: link in the header, and I want to see in Google Analytics when this link is clicked, and on what page. I've decided to do this using Event Tracking in Google Tag Manager. So I made a tag, with the following configuration.
And this is my Trigger configuration.
This is the HTML that this is referencing, (note that I also tried to add an onclick attribute, which was meant to push Event data directly to analytics. This didn't work.)
This is the variable configuration used in this tag.
This is proof it fires in the GTM debug pane.
And this is the summary coming in when you click on the item withing the pane.
In Analytics, this is what I see in the Real-time events tracking.
And this is what I see under the events overview.
So the tag is firing correctly, but the information is not going over to Analytics. I can find no resource on the internet that addresses this issue. Has anyone successfully pushed Google Tag Manager event tracking into Google Analytics? If so, what did you do to make it work, and what am I not doing/doing wrong that is preventing me from the result?
The end goal is I want to track the page where the click happened in Google Analytics' Events Overview, and also in the Goals section.
Thanks for that link, Uda! What was going wrong was my Google Optimize Tag. I paused all tags except my click-tracking and my Universal Analytics

Google Analytics propagate source

I am using Google tag Manager and Google Analytics.
I have a link on my yelp page like example.com/?utm_source=Yelp.
What I want is to be able to track that source even if the user clicks on a different link on my website, say to example.com/new-article.
So if a user fills out a form on that page, I know the user came from Yelp.
Summary:
A customer goes from Yelp to example.com then clicks another link. How can I still know that the user came from Yelp?
One strategy is I can append utm_source=$_GET['utm_source'] on all links on my page, but I assume google analytics or google tag manager has already solved that problem. I'm having trouble finding information on this.
Source is a session-level dimension, so if a user comes to your site with a utm_source param in the URL, that source dimension will be applied to all hits (pageviews, events, etc.) in the session.
In other words, you don't need to do anything special to make this work.

Is there a better way to track a redirect page with google analytics?

We are putting out a press release that contains links to our website and to other websites.
Right now I have a redirect.php on my website that is redirecting the user based off the variable located in the URL (e.g. redirect.php?id=1) using a meta refresh. Google analytics is loaded on the redirect.php so I can capture that visit and see where visitors are coming from before we redirect them to their final destination (either an internal page or an external page).
I do not like having to wait for google analytics to load before the user can be redirected.
Is there a better solution for this?
Here's how I would to it...
Take a look at How to Track Downloads & Outbound Links in Google Analytics
You have two kinds of links you want to track:
Links to other sites.
Links to your own site.
The how-to above will explain setting up clicks on offsite links as google analytics events (this is a better way to treat this activity than as page views).
You can then use the same basic methodology to track the clicks to your own site from within the press releases. You'll just need to find a way to select them in jQuery. Maybe by the id of the div contains your press releases, maybe you'll need to add a special class to the links you want to track. It would depend on how your page is set up.

Google Analytics - how does it track clicks?

So I'd just like help understanding how exactly google analytics collects this info. I have a homepage and the statistics say that 46% of clicks are on the logo (which links to the homepage). Does google analytics just assume that if they've ended up on the homepage they have clicked there?
How accurate is this measurement?
I wonder because I have a link that opens a modal, but the modal window doesn't "reinclude" the analytics code. Yet it has 46% of clicks also (the href is "#").
Is there any info on how it works?
Google Analytics is inferring a click on a link when a visitor ends up on a page from a prior page. You can observer this easily by looking at a page with multiple links to another page, and looking at the clickthroughs they get. Google tracks them as the same.
For example, I am on Page A and Page A has Link 1, Link 2, and Link 3. Links 1 and 3 point to Page B, whereas Link 2 goes somewhere else. If 37 people click on Link 1, and 43 people click on Link 3, Google will tell you that 80 people clicked on Link 1, and 80 people clicked on Link 3. The traffic isn't double counted however. It is just Google's way of showing you traffic.
The first rule of analytics analytics are not 100% reliable.
That being said, some can be quite reliable, and, I tend to trust Google analytics more than most others.
How does Google analytics work?
How to Track Internal Links in Google Analytics using Asynchronous Tracking
Tracking clicks with Google analytics
Tracking Link Clicks to External Sites with Google Analytics

Categories