4

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/

Tag Setup

Trigger Setup

6
  • Can you share your site?
    – nyuen
    Commented Oct 12, 2015 at 15:57
  • Are you just wanting to track the submission event with the radio button? Sorry, sounds straight forward enough, so not sure if I'm missing something.
    – nyuen
    Commented Oct 15, 2015 at 14:48
  • Your trigger doesn't seem right with the "Enable when" definition. Might want to change that to something else like "Pages URL matches regex .*". Again this sounds like something pretty simple, but not totally sure if you don't provide more info.
    – nyuen
    Commented Oct 15, 2015 at 17:38
  • @nyuen what other info can I provide for you?
    – czmudzin
    Commented Oct 15, 2015 at 18:05
  • Just look up and you'll see my questions.
    – nyuen
    Commented Oct 15, 2015 at 18:11

4 Answers 4

1
+50

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: https://support.google.com/analytics/answer/1136920?hl=en#GA

4
  • can you tell me how to accomplish this in Google Tag Manager? I do have that set up on my site, so I would just need to know how to create the tag and trigger.
    – czmudzin
    Commented Oct 14, 2015 at 19:09
  • This guide from Google explains how to track clicks as events in Tag Manager: support.google.com/tagmanager/answer/6106716?hl=en#AllClicks The previous link I'd provided includes a guide on tracking links clicks as virtual page views in Tag Manager. Together the 2 should give you the solution you seek. Let me know how you get on, and if this answers your question, please remember to mark it as answered :)
    – FarhadD
    Commented Oct 14, 2015 at 19:42
  • Since the URL does not change, are you saying that I should track the radio button and submit button as onclick events?
    – czmudzin
    Commented Oct 15, 2015 at 14:21
  • Yes. That's the best way to handle such tracking instances and then create a custom goal funnel that requires the event as a step in the conversion.
    – FarhadD
    Commented Oct 17, 2015 at 12:34
0

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.

0

To achieve it, please insert an event push while certain condition matched

https://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.

2
  • Are you sure? There is pointed that Classic Analytics is implemented on the site. Commented Oct 15, 2015 at 8:57
  • this is for lastest version analytics js. read the first line for conformation This guide explains how to implement event tracking with analytics.js. Commented Oct 15, 2015 at 11:14
-1

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: https://stackoverflow.com/questions/32765934/google-analytics-event-tracking-code-radio-buttons/32768321#32768321

2
  • If you downvote then please offer a reason so that we can all be more constructive, eh. Don't like my answer? Tell me why. We are all trying to help OP, are at least I thought we were.
    – nyuen
    Commented Oct 17, 2015 at 15:09
  • He probably down-voted it because your solution doesn't answer his question specifically. He wants to be able to track this via Goals in Analytics.
    – FarhadD
    Commented Oct 18, 2015 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.