سؤال

I am wondering if I can pass an Event, Virtual pageview and a a custom variable at the same time.

More specific...a user fills out a form. I need that lead to be recorded as an event in order for it to be standard across all platforms. I need a Virtual pageview in order to provided funnel analysis. And, I need Custom Variables to help segment my leads.

Any ideas on what this code may look like using Universal Analytics?....or if not, any suggestions with what it would like using ga.js.

Is this possible?

هل كانت مفيدة؟

المحلول

You bet. Put this onclick on your input type = submit:

onclick="_gaq.push(['_trackEvent', 'Form', 'Submit'],['_setCustomVar', 0, 'Name', 'Value', 1], ['_trackPageview', '/thankyoupage']);"

Essentially, you are doing One Push, Multiple Commands - https://developers.google.com/analytics/devguides/collection/gajs/#MultipleCommands. Just remember that a Custom Variable must always get sent with either a pageview or event.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top