Filth
Filth

Reputation: 3228

Google Analytics | Submit Data

I can't seem to find any info on how to do this but basically on submit I need to send either the mobile number the user inputted or the email not both, just one or the other.

_gaq.push(['_trackEvent', 'Friday Deals', 'Music and Sports', '[48r6KevWQkGNIgjRc95owg or xwPuPgV9D0ifMwjRc95swg]']);

In the array you will see the first name ( This is the mobile number name ) the second is the email name.

I am using the name attribute on the inputs.

Is this correct? How can I test to see if this is working in Chrome?

Upvotes: 1

Views: 40

Answers (1)

migueltic
migueltic

Reputation: 691

You can't do this. Sending personal data (like emails or phone numbers) to Google Analytics is against their Terms of service (Section 7):

You will not (and will not allow any third party to) use the Service to track, collect or upload any data that personally identifies an individual (such as a name, email address or billing information), or other data which can be reasonably linked to such information by Google.

Talking generally, if you really want to register only one data point of the two potentially available, it should be done server-side (the exact code depends obviously on what system and language are you using) and sent the result as a parameter to Google Analytics .

Alternatively, you could obviously register two data points at the same time (not just one or the other) using two parameters. You can put for example one as the "action" parameter and the other as the "label" parameter, like in this example

_gaq.push(['_trackEvent', 'Friday Deals', 'DATA1', 'DATA2']);

Or use the other optional parameter "value" to register a number. For example:

_gaq.push(['_trackEvent', 'Friday Deals', 'Music and Sports', 'DATA1', '54646465']);

Upvotes: 1

Related Questions