How to trigger a pageview using Google Analytics API upon form submission
-
I need to set up a goal using the G A API to trigger a pageview when someone submits a lead on my site. There's no "thank you"page currently. How do I go about it? There's no "thank you"page currently. How do I go about it? I have never used the API but am very familiar with analytics. Thanks!
-
OK, and where do i place the Javascript snippet? On a specific page on the site? Sorry, and Thank you, I am just a simple marketer
-
You would trigger this with JS at the time that your form is successfully submitted.
-
Thanks Martijn, where do I place the javascript unless I use the API?
-
Well using their API seems a bit to much overkill. But what you could do is a virtual pageview via JavaScript. Instead of doing the normal: ga('send', pageview'); you can do: ga('send', 'pageview', '/goal-thank-you'); then that url structure can be used in the settings of a goal in GA.
-
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
-
Using logical operators (AND / OR) in Google Analytics Goal Funnels
When setting up a Funnel within Google Analytics, is it possible to use logical operators (e.g. OR, AND) in the first (required) step of the funnel? For example, suppose I want to track users who visit page1.html AND page2.html before proceeding to the destination goal. I've entered two pages separated by the OR operator, and neither the "Verify this Goal" nor "Save" produces an error message - is it safe to assume that this is working as I intend? Thanks in advance!
Reporting & Analytics | | ahirai0 -
Google Analytics - Tracking multiple thankyou pages?
Hi Guys, I want to track email opt-ins for multiple thank you pages. The setup is as follows: http://image.prntscr.com/image/57632e05a15f42fda0b8ffec2d176460.png I have not yet built the thank you pages, so i was wondering what the URL should be to make it easy to track them in GA? I'm thinking: domain.com/thankyou-page/page1 Then using regular expression in GA to track /thankyou-page/ Would this be a good way to go about it? Cheers. f6c7r0
Reporting & Analytics | | spyaccounts110 -
Does referral exclusions remove the ecommerce value from Google Analytics?
Quick question on Referral exclusions. We have a client that just rebuilt their Magento website, referral data from Paypal was never an issue, the site properly attributed to source. New web devs finished the site and all purchases through Google Analytics from PayPal Is now showing as referral traffic. Doing research on the issue the suggestion was to create a referral exclusion in GA from PayPal. My question on that, will the ecommerce value default to the previous referral or will it delete the e-commerce value completely from what is gathered?
Reporting & Analytics | | BCutrer0 -
How to Configure Custom Alerts for Real Time Traffic etc from Google Analytic API?
Hi All, I know how to set alert from google analytic but i want alerts for real time visitors so i think it is possible via Google Analytic API, so can anyone share with me the process or relevant blog post? Regards, Mit
Reporting & Analytics | | mit0 -
Direct traffic spam on Google Analytics: how can you identify and filter it?
One of my smaller clients noticed a huge jump in direct traffic visits last month. The bounce rate was around 97% so I'm pretty certain that most of the traffic was illegitimate. I know how to filter out spam referrals and organic keywords in Google Analytics. However I'm not sure what to do about direct traffic spam. Are there recommendations for filtering this out? Can I identify spam IP addresses?
Reporting & Analytics | | RosemaryB0 -
How to FILTER in Google Analytics an ad campaign from linkedin?
Hi mozzers We are setting up an a linkedin ad campaign for our agency and want to track its traffic and conversions. The linkedin ad will carry UTMs for each link. For tracking this campaign accurately I thought about creating a new GA View with a specific filter. So my question is about the filtering, should i use the INCLUDE, REFERRAL with pattern LINKEDIN.COM (see image)? if not what would be the best way to track this campaign? My other concern is that we are also running other a job ad on linkedin and I feel these hits will be tracked as well. Is there a way to separate those 2 campaigns? Thanks guys! MzE5hqE.png
Reporting & Analytics | | Ideas-Money-Art0 -
How can we stop Google analytics pulling in data from another site?
We have a few accounts under one Google login. They all have separate Google analytics codes but one of the sites is somehow pulling in some data from another site but the other site has not got the same analytics code on it. Not sure how this is happening and what we can do about this, is it a bug in the Google Analytics system? Any help would be appreciated.
Reporting & Analytics | | dentaldesign0 -
Google Analytics and DNS change
Our new alumni application is going be tested at domain uva.imodules.com . We are going to collect traffic data with a Google analytics account number UA-884652-XX. So going to uva.imodules.com/myPage.html would send its data to Google Analytics with that account number. Then when it is ready for production we are going to just change the domain name of the application and switch the DNS over to dardencommunity.darden.virginia.edu . So going to dardencommunity.darden.virginia.edu /myPage.html would send its data to Google Analtics with that SAME account number. Aside from having the testing domain data in the same profile are there any other issues/problems we may run into?
Reporting & Analytics | | Darden0