> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://ajuda.greatsoftwares.com.br/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to set up event TRACKING in ActiveCampaign

To set up the **ActiveCampaign tracker** on your site in **GreatPages**, follow the tutorial below:

1. First log in to ActiveCampaign, click \*\*SITE \*\*> \*\*FORMS \*\*and then click **CREATE A FORM**;

![SITE > FORMS > CREATE A FORM](https://storage.crisp.chat/users/helpdesk/website/a6ab90d8350d6000/chrome3p0nngrnmo_1tvpc6z.png =650x318)

2. After that, give your form a name;

![create form](https://storage.crisp.chat/users/helpdesk/website/a6ab90d8350d6000/chrometzzh3tryvo_1qgp21t.png =650x318)

3. Click **integrate**;

![click integrate](https://storage.crisp.chat/users/helpdesk/website/a6ab90d8350d6000/chromed3zd8pstpp_17ujejm.png =650x318)

4. Press \*\*CTRL \*\*+ \*\*F \*\*and type **<form** to navigate to where the form settings are:

![Search for <form](https://storage.crisp.chat/users/helpdesk/website/a6ab90d8350d6000/chromegmgajudxmj_193ufaj.png =650x334)

5. Now, configure your script with the information from the form generated in ActiveCampaign

![configure our script](https://storage.crisp.chat/users/helpdesk/website/a6ab90d8350d6000/codeqki4fhbcjr_a36pnm.png =650x249)

The code in this image is the one below (change yours and save it to add in GreatPages):

```
<script type="text/javascript">
/* fornecido pelo ActiveCampaing clicando em Configurações > Rastreamento */
    (function(e,t,o,n,p,r,i){e.visitorGlobalObjectAlias=n;e[e.visitorGlobalObjectAlias]=e[e.visitorGlobalObjectAlias]||function(){(e[e.visitorGlobalObjectAlias].q=e[e.visitorGlobalObjectAlias].q||[]).push(arguments)};e[e.visitorGlobalObjectAlias].l=(new Date).getTime();r=t.createElement("script");r.src=o;r.async=true;i=t.getElementsByTagName("script")[0];i.parentNode.insertBefore(r,i)})(window,document,"https://diffuser-cdn.app-us1.com/diffuser/diffuser.js","vgo");
    vgo('setAccount', '477004287');/* setAccount é o seu ID de rastreamento, você pode encontrá-lo no ActiveCampaing clicando em Configurações > Rastreamento  */
    vgo('setTrackByDefault', true);
    vgo('process');
</script>

<script type="text/javascript">
window.EnviarActive = function() {
  var link = 'greatsoftwares29069', /* Link da conta, também usado para login */
      u=3, /* Campos do formulário exportado da ActiveCampaing */
      f=3, /* Campos do formulário exportado da ActiveCampaing */
      s='', /* Campos do formulário exportado da ActiveCampaing */
      c=0, /* Campos do formulário exportado da ActiveCampaing */
      m=0, /* Campos do formulário exportado da ActiveCampaing */
      act='sub', /* Campos do formulário exportado da ActiveCampaing */
      v=2, /* Campos do formulário exportado da ActiveCampaing */
      email='input_XXXX', /* Campos do formulário GreatPages */
      fullname='input_XXXX'; /* Campos do formulário GreatPages */
  _load_script('https://'+link+'.activehosted.com/proc.php?u='+u+'&f='+f+'&s='+s+'&c='+c+'&m='+m+'&act='+act+'&v='+v+'&email='+encodeURIComponent($('#'+email).val())+'&fullname='+encodeURIComponent($('#'+fullname).val())+'&jsonp=true');
}
window._show_thank_you = function(id, message, trackcmp_url, email) {
  const vgoAlias = typeof visitorGlobalObjectAlias === 'undefined' ? 'vgo' : visitorGlobalObjectAlias;
  var visitorObject = window[vgoAlias];
  if (email && typeof visitorObject !== 'undefined') {
    visitorObject('setEmail', email);
    visitorObject('update');
  } else if (typeof(trackcmp_url) != 'undefined' && trackcmp_url) {
    _load_script(trackcmp_url);
  }
  if (typeof window._form_callback !== 'undefined') window._form_callback(id);
};
window._load_script = function(url) {
  var head = document.querySelector('head'), script = document.createElement('script');
  script.type = 'text/javascript';
  script.charset = 'utf-8';
  script.src = url;
  head.appendChild(script);
};
</script>
```

Great, we're almost done!

Now, log in to GreatPages. There we need to create a form because this ActiveCampaign tracker needs your customer's email in a cookie.

6. Now, log in to GreatPages. There, we need to create a form because this ActiveCampaign tracking tracker needs your customer's email stored in a cookie. To do this, create a form on your page and click **"Edit"**;

![Creating a Form in GreatPages](https://storage.crisp.chat/users/helpdesk/website/-/a/6/a/b/a6ab90d8350d6000/image_1qg81qz.png =650x523)

7. Next, insert this code in the **"JavaScript do botão"** field:
```
/* Add no formulário */
if(typeof window.EnviarActive == 'function'){ EnviarActive(); }
```
![Paste the button js](https://storage.crisp.chat/users/helpdesk/website/-/a/6/a/b/a6ab90d8350d6000/image_16uc5gk.png =650x672)

8. Click **PREVIEW**, and a new tab will open with a preview of your site;

9. Right-click on the email input (email field) and click inspect;

10. Now copy the id and paste it into the code field. (We added a comment /\* Campos do formulário GreatPages \*/ ) =)  

![Inspect element](https://storage.crisp.chat/users/helpdesk/website/a6ab90d8350d6000/fx47mbgofb_pwci5r.png =650x197)

11. Now let's paste our Marketing code \o/
Go to the page editing tab, click the gear and then Javascript & CSS

![Add a script to the page](https://storage.crisp.chat/users/helpdesk/website/-/a/6/a/b/a6ab90d8350d6000/image_819am8.png =650x172)

![](https://storage.crisp.chat/users/helpdesk/website/-/a/6/a/b/a6ab90d8350d6000/image_473efs.png =650x455)

![](https://storage.crisp.chat/users/helpdesk/website/-/a/6/a/b/a6ab90d8350d6000/image_1hc8acw.png =650x451)




![Marketing code](https://storage.crisp.chat/users/helpdesk/website/-/a/6/a/b/a6ab90d8350d6000/image_1nd6ugp.png =650x318)
Paste the entire script we created and publish your page.

All set, now when a customer fills out this form a cookie will be installed and ActiveCampaign will track them.

![Contacts](https://storage.crisp.chat/users/helpdesk/website/a6ab90d8350d6000/chromempvavdapma_116d04r.png =650x318)

![ActiveCampaign tracker working](https://storage.crisp.chat/users/helpdesk/website/a6ab90d8350d6000/chromehvxfg4kaqr_1cjpjo0.png =650x515)

Still have questions? Reach out to our team on Chat! We're always happy to help. :-)  