• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

How do I pass a form value to Google Analytics

Explorer ,
Jul 29, 2012 Jul 29, 2012

Copy link to clipboard

Copied

I would like to pass a form value to Google Analytics. ie. if the user enters a value and submits the form, on the confirmation page I'd like to read the value and other form fields and pass those populate the Google Analytics tracking code ie. populate this withthe form values:

_gaq.push(['_addItem',
     
'1234',         // order ID - necessary to associate item with transaction
     
'DD44',         // SKU/code - required
     
'T-Shirt',      // product name - necessary to associate revenue with product
     
'Olive Medium', // category or variation
     
'11.99',        // unit price - required
     
'1'             // quantity - required
  
]);

TOPICS
eCommerce

Views

697

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 29, 2012 Jul 29, 2012

Google won't pick that up Kenneth.

Custom conformation page, pass variables through via the URL and use the URL module to fetch those and popular the analytics values.

Votes

Translate

Translate
Participant ,
Jul 29, 2012 Jul 29, 2012

Copy link to clipboard

Copied

How about this - bind an ajax call to google analytics to the form submit button (change the type from submit to button or suppress the default event), having the form itself only submit after the ajax call is successful? No need to even worry about the confirmation page then.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 29, 2012 Jul 29, 2012

Copy link to clipboard

Copied

LATEST

Google won't pick that up Kenneth.

Custom conformation page, pass variables through via the URL and use the URL module to fetch those and popular the analytics values.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines