Google Analytics Custom Tracking - google-analytics

For marketing purposes, if a link to our company website is posted on a page on an external website. Is it possible to track the time in which the user landed on the external website and clicked on the link to our company website, using custom tracking ?
I have been reading about custom GA tags however am having a hard time understanding how to make the above possible.
Thanks in advance!

You cannot track an external website, as you can only track sites where you control the tracking code.
If you have control over the external site and have implemented analytics tracking there you would
create a timestamp on page load
add an onclick event handler to the link to your site
in the callback function for that link create another timestamp, substract the original timestamp to get a duration
send a user timing call:
ga('send', 'timing', 'Link', 'Duration to click', duration);
Where the "duration" parameter would be replaced with your timestamp.
As I've said that would only work if you can run your own Google Analytics on the external site which does not seems very likely. Plus I have really no idea what you mean by "custom GA tags" (there are custom variables and custom dimensions/metrics, both of which will not help you here).
So basically the anwser is you can't, really.

Related

Tracking help center article link clicks in Google analytics

My company's support department uses freshdesk to handle our help desk tickets and also to host our solution center articles. I am trying to track when users click links to our help center articles that we put in our ticket replies. So far I've been trying to do this by using utm parameters, and creating a unique campaign for each article. I am running into difficulty programmatically accessing the text area where we type our replies to add the utm parameters to links before they are sent out. I am wondering if there is a better way to go about this that I'm not thinking of. I know this is pretty specific, but any ideas are very Appreciated!
Managing distinct campaign names for each help article may be a hassle. I'd suggest you turn to event tracking for this kind of task. You may have set up sending an event to analytics each time a link to help article is clicked and put the URL of the link to some of the event parameter e.g. 'event action' or 'event label'. So then you can get the event data in Behavior > Top events reports for each link
Some links for you to explore:
About Google Analytics Events
Tracking link clicks with Google Tag Manager
Event tracking with google analytics.js

Google Tag Manager. Tracking link click through a funnel

I had a question about Google Tag Manager. (I also felt bad for having the IT guy fix my mistakes on my simple click tag)
I wanted to track when a user enters a specific url when they click a link button on the homepage.
This is what it looks like
Image
This is my idea on what the Tag and Trigger should look like
Image
But I'm worried about having the trigger be fired when there is another page in the funnel
Also if the only way to do this is in the goal feature of GA that is good to know also. (I currently don't have the permissions here)
Thanks for responses
While it is difficult to achieve exactly what you're describing (it would involve storing data in cookies and then using these cookies to conditionally fire tags), there is a better way to achieve what I assume is your ultimate objective: an analysis of the shopping funnel.
Specifically, the Google Analytics enhanced ecommerce module has a dedicated report (the Conversions > Ecommerce > Shopping Behavior report) that shows you exactly this. It shows you the number of sessions for each stage of your shopping experience (product view -> add to cart -> checkout -> purchase) along with drop-off rates and volumes between each of these steps.
It is a little bit more involved to implement enhanced ecommerce but the final result is definitely worth it for an ecommerce business. Instructions for implementation of enhanced ecommerce (using Google Tag Manager) can be found here.
GTM is hit based without any notion of persistence. So by default this will not work.
You would need a custom HTML tag with a javascript function that sets a cookie, or writes a value to localstorage, when the button is clicked.
Then on your destination page you can check if the cookie exists and fire the tag accordingly.
I don't think the goal feature in GA can do that, either. A goal is registered when you hit a destination URL or event, you cannot specify conditions other than the destination.

How to Send / Create Google Analytics Event for Wordpress User Registrations / Logins

This seems like it should be a rather important use case for GA events but I really couldn't find any instruction on the net.
I'd like to create an event for any new registrations on my Wordpress site. If I can append that to logins as well, even better but the former is more important.
I also use WooCommerce so I'd need to ensure registration through that code path is included as well.
I'm familiar enough with adding the GA event code, I'm just not sure where to place it in this instance. I feel as if this functionality should be baked into the platform or most plugins. Maybe it is.
I noticed the 'Google Analytics for Wordpress' plugin has a checkbox for adding tracking code to registration pages however I'm not sure what exactly that does on the GA side? Does it create events? Is this whole question therefore pointless?
Any help here is appreciated.
I noticed the 'Google Analytics for Wordpress' plugin has a checkbox for adding tracking code to registration pages however I'm not sure what exactly that does on the GA side? Does it create events? Is this whole question therefore pointless?
From what I remember, by checking that box you create a custom variable for Logged In Status. By creating a custom variable, you can then create segments off of that and look to see how logged in users use the site compared to non-logged in users.
However, if you simply want to track new registrations, you could add GA event tracking to the submit button when the user submits the registration form.
If I were you, I'd do both.
If there is a page they land on after registering then just register that page as a goal in GA. I get your intent behind registering it as an event, but it might be easier to just do it as a goal.

Google Analytics Tracking Conversions with vendor data and custom campaigns

Please help me understand this. I have a client for whom we created a sweepstakes "mini site". Traffic was generated through banner ads, eBlasts, and newsletters. For the banner ads, I created custom urls, i.e. www.somewhere.com?utm_source=yahoo?utm_campaign=abc to track the traffic to the landing page per vendor/banner. this works just fine.
The entrant visits the page, signs up for the sweepstakes, has as double opt in email process for verification. All of my entering traffic to the landing page is tracking fine, and is properly broken down by utm_source and utm_campaign.
Some of the vendors had me place tracking pixels on the confirmation page for conversion statistics. The only info I have placed for internal tracking on the confirmation page is the GA tracking code.
I have been told to create tracking pixels to track the individual vendor conversions. Is this possible without the originating pixel data from the vendor? I am new to tracking pixels, but my understanding is that I need some information from the vendor in order to write the code for the pixel. Am I wrong?
I can't understand how we can place a tracking pixel on our end without at least campaign name or data from the vendor's tracking pixel that they placed on the page containing our banner ads.
What am I missing here? How can I actually separate the conversion traffic from the different sources when everyone receives the same double-opt-in email?
Please ask me to clarify if I am not being clear. Thanks in advance for reading my question.
There are two things you are trying to track here. One is Campaigns: Campaigns are how you measure the effectiveness of techniques to bring users to your site.
The other thing you are tracking is Events - this is what users are doing once they arrive at your site. If you want to track individual vendor conversions, you should add an onclick handler to either the submit button, or link that you are calling a "conversion"
For example:
Your link here
If you are adding the push to a form submit, you might want to have that push happen on the pageload of the success page, rather than the onClick of the submit (otherwise it will track the event, and it might not have actually happened due to form validation errors for example)

Google Virtual Pageview Setup

I need some help with the setup of tracking virtual clicks on a submit button. What I need to do is get the referring site, which Google already tracks, and then track if they click on the button. I have setup an onclick for the submit button and setup a goal in Analytics but it is not tracking. I do have the code in place for Analytics in my header to track pageviews.
So what I am trying to do right now with my goal is to track a referring website and then track who clicks on the button. The virtual view I am using for the click is:
onclick="pageTracker._trackPageview('/Orders/Subscription');"
Thank you for any help in getting this setup working. I am still working on learning analytics.
If you want to ...get the referring site, which Google already tracks at the time the user clicks the submit button, you will have to read the cookies (the _utmz in this case) that GA sets and extract it from there.
Referral data can be obtained from the reports in GA, but if you want it at the time of submit, you'll have to get it from the cookies. Plain vanilla javascript can do this for you, just google it. Or, use whatever language your pages are written in to extract the data from the cookie (PHP and many others have this capability).
Regarding tracking the virtual page view, if the user can submit your form by hitting the enter key, then onclick is not desirable. onsubmit in the form tag would be better.
If it is still not recording for you, make sure your goal steps are entered into GA correctly (it's quite common to mess this up and GA is not forgiving to even the slightest error) and that you are using the traditional tracking snippet in the head of your document because your example is in the traditional tracking format. You should not mix async and traditional snippets.
To check if GA is even tracking your virtual page, go to the Content, Top Content report and filter by your virtual page. If it's in there, then it's your goal tracking set up. If it's not in there, it's your virtual page tracking on the form itself.
HTH.

Resources