1. Open the landing page editor. Then click on the element on which you want to track the event and select "Advanced" from the side panel. After that, copy the ID of this item and leave the editor.

2. Then go to the "JavaScript Code" tab and click on add a new script that will use the previously copied ID of the selected item.

3. To create it right, go to the Google Analytics for Developers

You will have to choose gtag.js or analytics.js, depends on which script do you use. 

If you are not sure, check your tracking code, gtag.js looks like this:

and analytics.js is similar to this:

4. Then, select the "Event tracking" tab in the left menu and look at the example tracking code. Copy it and go to your landing page editor.

ga('send', 'event', 'Videos', 'play', 'Fall Campaign');

or

gtag('event', 'aaa', {
  'event_category' : 'bbb',
  'event_label' : 'ccc'
});

5. Now, go back to adding a JavaScript code - you have to call it right and enter according to the scheme that I present below:

<script>
$ ('#copiedIDfromtheeditor') .on ('click', function () {
// begin of copied script:
ga ('send', 'event', 'name1' , 'name2' , 'name3' );
// end of copied script
});
</script>

or

<script>
$ ('#copiedIDfromtheeditor') .on ('click', function () {
// begin of copied script:
gtag('event', 'aaa', {
  'event_category' : 'bbb',
  'event_label' : 'ccc'
});
// end of copied script
});
</script>

In places "name1", "name ...", "aaa", "bbb", "ccc" enter the data associated with your item, according to the scheme from the original Google Analytics code. Once you entered the code, save it.

6. After adding the code, go back to the editor and publish your landing page. Next, click on its address and switch on the developer tools with the right mouse button.

7. Look for an item on the landing page for which you assigned the tracking code. Click on it and check the "Console" tab at the bottom of the page.
If you click on an item and it does not generate errors, everything should be working correctly.

You can follow the selected items by assigning codes properly.

If you have any additional questions, please email us at support@landingi.com.

Did this answer your question?