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
-
Different statistics in Google Analytics
Hi! A client of mine is having some trouble on his Google Analytics overview. When he checks the yearly report with number of visitors, new visitors, returning, ... he gets statistics that doesn't match mine. Also, he gets a notation from Google that no hits were fired, although the script is still there. On the other hand, I (logged in with another account) am seeing all statistics correctly. FYI: no filters were installed, nor segments, ... Why does the client see different and incorrect statistics? There should be a setting or something I'm overseeing. Hope you guys can help.
Reporting & Analytics | | conversal0 -
Tracking Sessions for 301 Re-Direct in Google Analytics
Trying to track clicks for individual slides on a homepage slider. I cannot enter UTM codes on the slide links, just choose from a dropdown containing pages on my site (WordPress). So, I set-up 301 re-directs for all the slides. /slide1-redirect
Reporting & Analytics | | jbernier
/slide-2-redirect etc.. Will these redirect pages show up in GA? I cannot see them. I'm trying to create a Dashboard for Homepage slider clicks. John0 -
Google Analytics unexplainable traffic spike
Viewing this report **Behaviour > Site content > All pages **with primary dimensions of **Page ** and **Page title **are showing different results for one specific page on our site. We noticed a huge spike in pageviews and entrances to that specific page on our site. The user flow report shows traffic going through and from the page (in high volume) from other pages on the site which suggests that it's not the usual case of spam referrals. When I view the report above by page, I get unrealistic data. Over 600% increase in pageviews and over 900% increase in entrances. When I view by page title however, I get realistic results. Can anyone help shed some light on why these two reports will be different? Anyone else seeing similar issues?
Reporting & Analytics | | OptiBacUK0 -
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 -
Google Analytics - Next Page Path is the Same URL?
Hey Everyone, I have a Google analytics question. I'm looking through a client's site and when I look at the next page path, I get the same URL as the next path. For example, on the homepage, the next page path I get is the homepage again? This happens for all URL's, is this an implementation error? Is there a way to fix this? Thanks!
Reporting & Analytics | | EvansHunt0 -
How to remove unwanted dynamic parameters from a URL in Google Analytics
Hi, Would really appreciate some help with this. I have been experimenting with RegEx to achieve this but as I’ve never used it before am currently failing miserably. We have conversion pages i need to set goals for that are formatted as below: https://www.domain.co.uk//Application_Form/(S(ewhbqp5cki0mppuzukunkqno))/enterCardDetails.aspx I need to remove the (s(xxx)) section from the URL as rather than one pages i currently have thousands of unique URL's. What’s catching me out is that as it’s not a URL parameter I can’t discount and as half way through can’t just do head matches etc to /entercarddetails Help would be much appreciated. Thanks.
Reporting & Analytics | | Sarbs0 -
Track banner ad with google analytics
Hi We have a top banner ad on an external renown site only to attrack traffic. It does show up in google analytics, but i have seen some increase in (direct) / (none) traffic. Is there anyway i can track it when banner is showed from 2 separate URLs http://www.tv2torget.no/bedrift/netthandel/ and http://www.tv2torget.no/bedrift/netthandel/barneklaer/ Thanks Dan Lærum
Reporting & Analytics | | danlae0 -
Transferring Google analytics accounts
Hi, Does anyone know if you can transfer an Google Analytics account. We are looking to take over a new clients existing website and the analytics account is registered to their current web designers. Is it possible to transfer it to the client so that their existing web company no longer has access and they keep all their historical data, or do we have to start from scratch. Thanks Fraser
Reporting & Analytics | | fraserhannah0