: Google Analytics Goal with Radio Selection and Onclick Event I'm trying to create a goal in Google Analytics that tracks the type of account being created in our system. Unfortunately, the URLs
I'm trying to create a goal in Google Analytics that tracks the type of account being created in our system. Unfortunately, the URLs aren't definitive to the type of account creation, and the only elements I have are a button and a radio selection.
I need to track when a radio button is selected (and stays selected) at the time of the submit button click.
Can anyone help here? This is beyond my expertise in GA.
*I am using Classic Analytics
<input type="radio" id="program1" name="accountProgram" value="VT" onclick="showProgramInformation(this.value);" data-parsley-multiple="accountProgram" data-parsley-id="2155">
Edit: Will the following work in Google Tag Manager?
(assuming I add the onClick event to the submit button)
Code from radio button that must be selected:
<input type="radio" id="program1" name="accountProgram" value="VT" onclick="showProgramInformation(this.value);" data-parsley-multiple="accountProgram" data-parsley-id="2155">
Code for Submit Button
<input type="submit" name="completeRegistrationForm:j_idt109" value="Complete Registration" class="btn">
URL path that contains form
/account/complete-registration/
URL reach after form submission
/account/
More posts by @Megan663
4 Comments
Sorted by latest first Latest Oldest Best
Without much more information about the page/form, one option would be to grab the ID of the clicked button and store that into a variable, as those look like they uniquely identify the account program. When the submit button is clicked, then send in the value of that variable as the label. Note that if you have multiple account types to track, then you would want to create one event goal only where you have a common category and action, but don't configure the goal with a label otherwise you will need to set up as many goals as you have acct types. You'll see all the unique events in your events reports, but you won't see the unique goals in your goals reports.
Edit: similar to this, which I posted a while back ago: stackoverflow.com/questions/32765934/google-analytics-event-tracking-code-radio-buttons/32768321#32768321
To achieve it, please insert an event push while certain condition matched
developers.google.com/analytics/devguides/collection/analyticsjs/events
ga('send', { hitType: 'event', eventCategory: 'Videos', eventAction: 'play', eventLabel: 'Fall Campaign' });
You can apply this to each event need to be tracked.
In your case, obtain value from radio field , apply conditionals and fire analytics data-push
For more depth, send the snippets of code so it could be rectified more accurately.
What you need to do is create multiple goals that are based on the final URL and the paths taken. The trick then is to trigger a pseudo pageview via an event when the user clicks on one of the radio buttons and then set that page as a required step in the conversion funnel path.
Google Tag Manager is much better equipped to deal with situations like this.
In its simplest form the event trigger can be coded using a gaq.push function:
_gaq.push(['_trackPageview', '/convert/optionClicked']);
This link explains how to track outbound link clicks, but the same principle can be used to also track other click events and generate a pageview: support.google.com/analytics/answer/1136920?hl=en#GA
You'll want to put a bit of JS in your after-form-page header that checks the POST content for that radio button and then calls _trackEvent() if it finds what it's looking for.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.