Google Analytics Event Tracking
-
Hi Guys,
I want to set up a goal in Google analytics for this site http://www.dfrsolicitors.co.uk/contact.php and the contact us form is in php (so there is no thank you html page). I know there is a piece of code "onsubmit" or whatever it is, but I can't find it.
I want to be able to track successful submissions.
Kind Regards
Neil
-
The code you have added just tracks page views, so far, so you will need ti track the button with an event and then in GA you can define a goal by these parameters in the event you have just created
-
Hi David,
Thank you so much for you help. I have just a couple of quick questions.
We have put the code in here:- http://www.dfrsolicitors.co.uk/contact.php does this look right? and in terms of GA what special thing to do I need to do to start counting goals via the "conversion" tab. Obviously if I set the goal as contact.php it will only record people coming to the page not submitting the form.
Kind Regards
Neil
-
As long as your analytics.js is across all pages including the contact.php you dont need to put in th UA
for the inline one it would look something like
as for the query it would be something like this
and then ad the jquery before the end of the document
-
Brilliant!! Exactly what I was looking for. Where would this go and do I need to put my UA number in?
-
something like this?
onsubmit="ga('send', 'event', 'Form', 'Submit', 'Contact')"
or by jquery
jQuery(document).ready(function ($) {
$('#formsubmit').on('click', function() {
ga('send', 'event', 'form', 'click', 'contact');
});
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
ECommerce Tracking in Analytics - Should I use a plugin or do it manually?
Hi, I have a WordPress site (woocommerce integrated). I would like to know should I use a plugin to enable e-commerce tracking in Google Analytics or I should do it manually with GTM. Which is a better way? Will using a plugin to enable e-commerce tracking slow down my site? Any thoughts? Thanks in advance.
Reporting & Analytics | | Mr.Suren0 -
Google Analytics / Facebook UTM
Hello, I have a quick question. I am setting up conversion tracking for my Facebook ads, so I am giving each ad set a tracking URL (UTM) in order to see which ads are converting etc. Is it possible to see on analytics how much I am spending on these ads or a cost per conversion? Or does the tracking merely track general analytics data such as bounce rate, exit rate, revenue generated etc? Kind Regards, James
Reporting & Analytics | | SO_UK0 -
Click-to-call mobile event tracking
Hello! I want to track calls on mobile devices from a website. I was able to successfully set up an event with Google Analytics that tracks when a user clicks the phone # on the website, however, as you know, when someone clicks a phone # using iOS it prompts a display of the # and gives the users two options, Cancel or Call. My question: is there any way to track when the user clicks the 'Call' action? Thanks
Reporting & Analytics | | RangeMarketing0 -
No Google Analytics code on page BUT reporting is active
How could Google Analytics be reporting data if my pages don't have the GA code on them? Mike
Reporting & Analytics | | Mike_c0 -
Universal Analytics Ecommerce Tracking in Magento
We have a problem similar to this: http://stackoverflow.com/questions/22229312/universal-analytics-could-not-track-transaction-in-magento On a client's website. I need an absolute knock-out EXPERT at solving this to give us a quote on doing something like this. It's very urgent but it is paid. Basically the site used the old tracking code, worked, then client said they wanted new data so we upgraded to Universal. Now everything works but Ecommerce tracking. Desperately need help! Thanks all!
Reporting & Analytics | | MattAntonino0 -
Moving data between Google Analytics Properties
Last summer we setup another Google Analytics property for us with Universal Analytics and have been running this alongside the old Google Analtyics property. is there a way of exporting all the old data from the old property into the new Universal Analytics property?
Reporting & Analytics | | ese0 -
Mobile and Google Analytics
As my mobile numbers are going up in Google Analytics I'm trying to figure out what phone runs what browser. I see that 93% of mobile users have Safari which I believe is iPhone, iPad and iPods. There is a 6% usage of "Mozilla Compatible Agent". What cell phone would this be?
Reporting & Analytics | | LabadieAuto0 -
Google Analytics - paid & unpaid visits messed up
I guess Google Analytics messes up my paid and unpaid visits. In the list of top 10 kw's sending non-paid traffic it shows 5 very short kw's that we don't rank for at all (checked with RankTracker - we are not in first 50 search results). But these are the kw's we advertise for... One more proof: Webmaster Tools 'Search queries' shows 10 times less 'Clicks' from organic search than Google Analytics. Is there anyone who is experiencing this kind of problems with GA? Is there anything you can do with it?
Reporting & Analytics | | Alexey_mindvalley0