# Google Analytics

You can send all airim events to ga by adding this snippet below the airim js code

```javascript
airim('subscribe', function(event){
  if (typeof(ga) === 'function') {
    ga('send', 'event', 'airim', event.event_name, event.event_value);
  }
})
```

If you are using gtag.js - Google Tag Manager instead of google analytics script, please use the code below

```javascript
airim('subscribe', function(event){
  if (typeof(gtag) === 'function') {
    gtag('event', event.event_name, {
      'event_category': 'airim',
      'event_label': event.event_value,
    });
  }
});
```

Event name is what type of action has been performed on the widget. Event value if any is the identification number on which the action is performed. Example: event\_name = faq\_click, and event\_value = 39. Id of the FAQ which is clicked.

#### Sample Event&#x20;

```javascript
{    
    event_cat_id: 108, // FAQ category id
    event_message: "Clicked on Question: What is life?",
    event_name: "faq_click", // name of the event
    event_obj: "FAQ",
    event_obj_id: 66,// FAQ id 
    event_type: "click" ,
    event_value: "What is life?"    
}
```

#### List of event names

* faq\_click
* upvoted\_faq
* cta\_click
* downvoted\_faq
* search
* tag\_search
* contact\_form\_open
* notification\_cta\_click
* widget\_open
* widget\_close
* airim\_live\_chat\_open
* live\_chat\_agent\_blocked&#x20;
* live\_chat\_agent\_snoozed
* live\_chat\_agent\_resolved
* live\_chat\_agent\_status
* live\_chat\_agent\_assigned
* live\_chat\_tat


---

# 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.airim.co/integrations/google-analytics.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.
