In this article, I will show you how to send event notifications to your Google Analytics account.
OK. In this case, let's consider the "button" and send the event to GA from it if you have two buttons with different calls to action.
- Once in the editor, publish the landing page and go to the landings panel by "Go to campaign" button.
and check that everything looks properly. If so, save it and go back to the landing editor.
4. In the new window, open Google Analytics for Developers. Once you are there, go to "Web Tracking".
5. 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');
6. Once you have navigated to the editor, double-click on the button where you want to add the tracking code or go to edit it with the 'pencil icon'.
7. Go to the "Settings" tab and paste the copied tracking code into the "onClick event" field. Next, adjust the code to the name and function of your button. Here, for example, I changed:
"Videos" --> to "Ebook";
"Play" --> to "Download"
8. Now adjust the code in the second button by changing its name accordingly to the button. Save and close changes.
'Videos' -> to 'Ebook';
'Play' -> to 'Learn more'
9. At this point, you can publish your lp. Then open it in the browser by clicking its link.
Hover your cursor over one of the buttons, then right-click and open the developer tools.
10. When you look at the bottom of the page, you should see the console. There you can find "onClick event" added before.
11. To follow events directly in your Google Analytics account, move to the side menu, then select the tab "Behavior" -> "Events" -> "Overview".
Here you can analyze all added tracking codes, remember that all the events will show up after about 24 hours.