M
M
mletov2019-06-16 12:46:04
JavaScript
mletov, 2019-06-16 12:46:04

How to pass parameters to Google analytics target?

The site has a form for collecting applications
. It has 2 fields: name and phone number.
By pressing the button, the goal is called ga('send', 'event', 'category', 'action', 'label')
But it became necessary to write not only the fact that the goal was completed, but also the form parameters for further export to Google Sheets.
So far, I've only come up with the option of passing form parameters to a label like ga('send', 'event', 'category', 'action', 'Vasya|+79213333333'), and then parsing.
Maybe someone knows a more beautiful and correct option?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman, 2019-06-17
@mletov

Why don't you want to write data to Custom Dimension? They were created for this, in order to transmit what you want yourself
https://developers.google.com/analytics/devguides/...
But there is a caveat: it is forbidden to store personal information in GA and there is a risk of losing the counter. Therefore, it is better to encrypt data before transmission.

D
Dimonchik, 2019-06-16
@dimonchik2013

the hash (context-dependent) is more correct, and the form data with the hash is separate,
but you can do it this way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question