# Events

{% hint style="info" %}
To use the Web SDK please [install ](/how-to-install.md)the snippet first.
{% endhint %}

**Commands will only work after popup is initialized (there is a callback for when it is initialized**).\
For example:

```javascript
getComplied.callback.oninit = function(data){
	getComplied.command('show');
}
```

| Command                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Description                                                                                                                                  | Values                                                                                                                                                                                                                                                                                                               |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `getComplied.command('show', {hideClose: false, asNew: false})`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Opens Modal                                                                                                                                  | <p>hideClose (when enabled, close button is hidden)<br>asNew (when enabled, updates consents as a new user, generating a new id and overriding the current session)</p>                                                                                                                                              |
| `getComplied.command('change-lang', 'pt-PT')`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Changes popup and inputs language                                                                                                            | language code ("en-GB", "pt-PT"...)                                                                                                                                                                                                                                                                                  |
| `getComplied.command('change-view', 'id', 119)`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | <p>Opens a specific resource by ID<br><a href="http://demo.getcomplied.com/?specifiqid-example=true">Terms & Conditions</a></p>              | int                                                                                                                                                                                                                                                                                                                  |
| `getComplied.command('change-view', 'index', 1)`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | <p>Opens a specific resource by Index</p><p><a href="http://demo.getcomplied.com/?specifiqindex-example=true">Open in the 2nd Policy</a></p> | int                                                                                                                                                                                                                                                                                                                  |
| `getComplied.command('change-view', 'static', 'languages')`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | <p>Opens a specific static view<br><a href="http://demo.getcomplied.com/?specifiqview-example=true">Open Languages view</a></p>              | <p>home<br>languages<br>contactdpo<br>thirdparties<br>cookies<br>edit<br>accessdata<br>movedata<br>beforgotten</p>                                                                                                                                                                                                   |
| <p><code>getComplied.command('user', {</code><br><code>Name: 'Firstname Lastname',</code><br><code>Email: '<user@email.com>',</code><br><code>Birthdate: {</code><br><code>Day: 1,</code><br><code>Month: 1,</code><br><code>Year: 1990</code><br><code>},</code><br><code>CallingCode: {</code><br><code>Code: '+351'</code><br><code>},</code><br><code>Country: {</code><br><code>Code: 'PT'</code><br><code>},</code><br><code>Gender: 0, // 0 - Male, 1 - Female, 2 - Other</code><br><code>Address1: 'Address Line 1',</code><br><code>Address2: 'Address Line 2',</code><br><code>City: 'CityName',</code><br><code>ZipCode: '0000-000',</code><br><code>PhoneNumber: '910 000 000',</code><br><code>BusinessEmail: '<user@company.com>',</code><br><code>CustomId: 'YOUR-CUSTOM-ID',</code><br><code>});</code></p> | Passes user information to GetComplied                                                                                                       | <p>Name<br>Email<br>Birthdate { Day, Month, Year }<br>CallingCode { Code ("+1", "+1-242", "+351" ...) }<br>Country { Code ("US", "PT", "GB" ...) }<br>Gender ( 0 - Male, 1 - Female, 2 - Other )<br>Address1<br>Address2<br>City<br>ZipCode<br>PhoneNumber<br>BusinessEmail<br>CustomId (string, max-length 256)</p> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.getcomplied.com/web-sdk/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
