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');
});
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
-
Moving wordpress themes, any best practices on setting up Google Analytics for the change?
We currently have a mess of filters and views in our Google Analytics instance. We have a chance to make a clean start. Wondering if creating a whole new property is a good idea? Or just some additional views? Any other pointers would be greatly appreciated. Thanks!
Reporting & Analytics | | jill.myers0 -
Is there a way to filter all computers on a specific IPv6 network in Google Analytics?
Is there a quick way of filtering the IP addresses for all the computers on a network that's using IPv6? I want to filter out visits to our websites from the devices on our office network, but each computer (and phone and tablet) seems to have a different address. It _looks _like they all start the same way, though. One computer is xxxx:xxxx:xxxx:xxxx:aaaa:aaaa:aaaa:aaaa, another is xxxx:xxxx:xxxx:xxxx:bbbb:bbbb:bbbb:bbbb, my phone is xxxx:xxxx:xxxx:xxxx:cccc:cccc:cccc:cccc, etc. Does this mean that xxxx:xxxx:xxxx:xxxx is the address for our network as a whole, and I can just set up a Google Analytics filter for "IP addresses starting with..."? Or would doing that also filter out hits from, like, every visitor within a 20 mile radius of our office? If I need to simply put in the individual addresses for each and every device, I will. I'm just hoping it doesn't come to that. Thanks!
Reporting & Analytics | | BrianAlpert780 -
Google Analytics Question - Impressions & Queries Up, Sessions Down
I'm working with a client who, according to the Google Query report, impressions and sessions are up since we've started work with them about 6 months ago, but Google sessions are down. In moz, we're seeing a gradual, but steady increase in search visibility specifically with Google. Note: this is all organic. From when we started tracking queries, the first month we were tracking there were 43,581 impressions and 690 click throughs for the month. This past month there were 98,293 queries and 1015 clicks throughs for the month (granted not year over year data) - of these 1,015 clicks, 995 of them were from web. However, for those same time periods, sessions from Google are down over 30% - 1,750 vs. 1,189. I'm not sure how to interpret this. I realize that clicks and sessions are not a straightforward comparison, but I would think that if clicks were up according to the query report that sessions would also be up. Is it that some of these clicks are bouncing and therefore not being tracked as a session? Is there a potential issue with how data is being tracked?
Reporting & Analytics | | Corporate_Communications0 -
Google Analytics SEO Queries Not Showing
Hi All, This might be a silly question, but for all the properties I monitor in Google Analytics, I'm now showing no data for SEO Queries under Acquisition for the past 6 days. Normally I would expect a few day delay in queries, but nothing for 6 days is somewhat peculiar especially as it was functioning fine prior to November 12th. Does anyone have insight into what might be going on? Thanks! URaNMa3
Reporting & Analytics | | amichaels0 -
Track subdomains in the same analytics property/view
Hello to everyone, this is my first question (kind of a newbie here :-D). I have a website that spans over 4 subdomains + the main domain and I'd like to have a place where I can see the total page views, events and goal completions. Main domain is langhe.net, and subdomains are eventi.langhe.net, servizi.langhe.net, shop.langhe.net, about.langhe.net. The website is based on wordpress and I'm using google analytics for wordpress by yoast as analytics plugin. The configuration of the plugin is as follows: all the website have the same UA-XXXXXXXX code The Subdomain Traking field (setDomainName) is filled with .langhe.net Cross-Domain tracking is enabled Cross-Domain Primary Domain (setDomainName) is langhe.net Cross-Domain Tracking, Other Domains field is filled with: about.langhe.net, eventi.langhe.net, servizi.langhe.net, shop.langhe.net. In the GA property I've created an Advanced Custom Filter configured this way: Field A -> Extract A = hostname (.*) Field B -> Extract B = request URI (.*) Output To -> Constructor = request URI $A1$B1 Field A Required: yes Field B Required: No Override Output Field: yes Case Sensitive: no I was wondering it this is the best way of doing it, or if there are other "best practice" ways to obtain what I'm looking for (for example with this configuration it's become quite difficult to separate the traffic sources for each website). Thank you in advance 🙂
Reporting & Analytics | | Enrico_Cassinelli
Cheers!0 -
Google Analytics: Trackbacks & Network Referrals?
Buon Pormeriggio from 15 degrees C mostly cloudy Wetherby UK 🙂
Reporting & Analytics | | Nightwing
Whats the difference between Trackbacks & Network referrals within Google analytics social media reporting? I'd like to specifically understand why a link to site i'm working on withing this post:
http://huddled.co.uk/huddled-interviews-nicola-schaefer-from-liverpool-fc-e-l-i-t-e-s-8335/ is classed as Trackback & not a Network refferral 😞 Illustrated here is the link thats being recorded as a track back:
http://i216.photobucket.com/albums/cc53/zymurgy_bucket/track-back-query_zpsbab2679b.jpg And here is the data:
http://i216.photobucket.com/albums/cc53/zymurgy_bucket/google-trackbacks-2_zps2861fa17.jpg But why is not showing up in Network referrals? Thanks in advance,
David0 -
Totally Remove "localhost" entries from Google Analytics
Hello All, In Google Analytics I see a bunch of traffic coming from "localhost:4444 / referral". I had tried once before to create a filter to exclude this traffic source, but obviously I did it wrong since it's still showing up. Here is the filter I have currently: Filter Name: Exclude localhost
Reporting & Analytics | | Robert-B
Filter Type: Custom filter > Exclude
Filter Field: Referral
Filter Pattern: .localhost:4444.
Case Sensitive: No Can anyone see what I'm doing wrong and give me a push in the right direction? Thanks in advance!0 -
Track Google/Bing Shopping as Referrer
Is there a way to track Google & Bing Shopping referrals independent of standard Google/Bing tracking? It would be nice if we could see the difference between Google PPC, Google Organic & Google Shopping. I notice in analytics that we get some traffic from google/ppc, some from google/organic, some from google.com/referral (not sure what this is), and some from googlebase/cse (I know this is Google shopping, but I don't think it's tracking all shopping referral visits as this).
Reporting & Analytics | | JerDoggMckoy0