> For the complete documentation index, see [llms.txt](https://safary-1.gitbook.io/safary-doc-2.0/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://safary-1.gitbook.io/safary-doc-2.0/connect-data/social-logins/google-auth.md).

# Google Auth

{% embed url="<https://www.loom.com/share/b02224ada7134e4d8845a5781731f211?sid=0df2027e-6a2b-4068-92cc-022f4eb47549>" %}

## Google Auth Event

The `form` event can also be used to track user information after authenticating with Google. Simply submit an event with "form" as the `eventType`, any appropriate name as `eventName`, and add the `e-mail`and (optionally) `name` as attributes in the field `parameters`.

{% hint style="info" %}
&#x20;You can also add any other desired fields in `parameters` as long as you follow the guidelines in the [Custom Parameters subsection](#custom-parameters).
{% endhint %}

<table><thead><tr><th>parameters</th><th width="138">TYPE</th><th width="150">USE</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>email</td><td>string</td><td><mark style="color:red;"><strong>Required</strong></mark></td><td>Authenticated e-mail </td></tr><tr><td>name</td><td>string</td><td>Optional</td><td>Name of account</td></tr></tbody></table>

Example only with required email field:

```javascript
safary.track({
  eventType: "form",
  eventName: "google-auth",
  parameters: { 
    email: "user@example.com"
  }
})
```

Example with optional name field included:

```javascript
safary.track({
  eventType: "form",
  eventName: "google-auth",
  parameters: { 
    email: "user@example.com",
    name: "John Doe"
  }
})
```

Please note that the `parameters` field can also include any other information you believe is useful to track, as long as you follow the guidelines in the [Custom Parameters subsection](#custom-parameters).

See the last section of this page for troubleshooting.

***

## Troubleshooting

Required arguments:

* Note that `eventType` + `eventName` are required arguments for `safary.track` .
* Therefore, for example, the following would **not** work:

```tsx
safary.track( { eventName: "main offer" } )
// Gives:
// ERROR: safary.track(): eventType is undefined.
```

Required format:

* Note that the `parameters` used in the both tracking functions is required to be an **object.**
* Therefore, for example, passing a **string** as `parameters` would **not** work:

```tsx
safary.track( { eventType: "buy", eventName: "main offer", parameters: "ETH" } )
// Gives:
// ERROR: safary.track(): parameters is not an object.
```
