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
-
Google Analytics Landing Page Report Discrepancy
I have noticed that when I run a landing page report and use the advanced option so I can view only the landing pages that include a particular string in the URL, have noticed that I in the report, the graph at the top will say one thing, but the data below says something else. For example, the graph for one particular search shows 200 Impressions, but the info below says 700 impressions and 610 clicks. Anyone seen anything similar or have any ideas why? Thanks! Craig
Reporting & Analytics | | TheCraig0 -
How drop off works in google analytic for enhance ecommerce?
Hello Guys, I have implemented enhance ecommerce ( i.e. - https://developers.google.com/tag-manager/enhanced-ecommerce ) Now i have query how drops off actually works? Like i visited the my site, then product page then checkout step 1 page after that i close the checkout step 1 page that means checkout step 1 drop off will appear in google analytic? right? John
Reporting & Analytics | | varo0 -
Tracking Google places (7 pack listing) traffic in google analytics
Is there a way to see Google Places traffic (traffic from users clicking through the 7 pack listings) segmented in Google analytics ? Normally is it just lumped together with the organic traffic ? Can you see the search phrases used to find your site, or do they also show up under 'not provided' when from Google Places. Im aware i can see some limited data in the Google Places analytics, but these seem to be 2 days behind when ever i view them.
Reporting & Analytics | | Sam-P0 -
Google analytics : exclude traffic to a subdomain
Hi, I have a website with a client access on a subdomain. I want to exclude the traffic to that subdomain because it messes up my conversion goal for the main site. Per example, 2 out of 10 visitors are existing clients that want to access to my SaaS product. The 8 other are potential clients. I want to exclude the 2 clients from my stats so I could have the good conversion percentage for my free trial for the other 8 potential clients. Thanks in advance for your help!
Reporting & Analytics | | slestage0 -
Google Analytics - Not provided info
Morning all, i am using Google analytics for some time now, One of the issues that i don't have a clear answer for is, when i am looking at Traffic Source --> overview In the Keyword column, that is a line (not provided) What we think here is that we cant see the keywords if someone arrived to our website but was logged-in to Google account Is this correct? is there a way to find the keywords behind this (not provided)? - i have many visits for this line (17.3% of all visits) and i don't know which keywords people used. Thank you SeoWise
Reporting & Analytics | | iivgi0 -
Using Regex for Goals in Google Analytics
I’ve got a website with 20 different forms; and I’d like to track all 20 form completions with one Goal in Google Analytics. The completion-page URLs follow the pattern below (the website uses Drupal CMS) Form One: www.acme.com/node/2990/done?sid=651 Form Two: www.acme.com /node/2991/done?sid=785 Form Three: www.acme.com /node/2992/done?sid=1021 Form Four: www.acme.com /node/2993/done?sid=459 I believe that there is a way I can use regex so Google Analytics will track if any of these completion URLs appears. Looking for guidance how to format the regex statement.
Reporting & Analytics | | TopFloor0 -
Alternative to Google Analytics
Hi from sunny Manchester! I'm looking for recommendations for alternatives to GA. I'm specifically looking for something which won't sample data and will give us accurate numbers. Our site is pretty big, it receives 6 million+ visits and 50 million+ pageviews/year. Any recommendations would be greatly received together with any good/bad experiences you've had with them. Thanks in advance, Brendan.
Reporting & Analytics | | Confetti_Wedding0