Log campaign events to Google Analytics
This article will describe three different ways of working with campaign follow-up in Google Analytics.
Log all campaign events
By listening to Triggerbee Onsite Campaign events, data can be sent to Google Analytics when a campaign is opened (eg. visitor viewed the campaign), a campaign is closed, submitted etc. All Triggerbee events and event data that you can use can be found here.
If you prefer working with Google Analytics through Google Tag Manager, check out this article about how to add the campaign events and campaign data to GTM.
Full example:
document.addEventListener("onTriggerbeeWidgetOpened", function (event) { ga('send', 'event', { eventCategory: 'Triggerbee', eventAction: 'Campaign Viewed', eventLabel: event.detail.campaignName }); });
Logging specific click events
Inside the Triggerbee Onsite Campaign Editor, scripts can also be added to execute on specific clicks. This is especially useful when having several buttons or multiple action points in your campaign. The general onTriggerbeeWidgetClicked event that is explained above will aggregate any clicks in every campaign you publish, but with button scripts - each button can have its own tracking.
This is done by adding the full GA tracker event (in the example above), or - if you want to minimize code, using the short version, eg:
ga('send','event','Triggerbee','Button Clicked','Winter Campaign');
Note: The script snippet is only an example. It needs to be adjusted to fit your Google Analytics setup.
Using UTM links as tracking
Inside the Triggerbee Onsite Campaign Editor, GA tracking can also be added via UTM links on specific clicks. Just add your UTM-tracking to the URL you want the button or widget to link to. For example:
https://www.yourwebpage.com?utm_source=triggerbee&utm_medium=widget&utm_campaign=wintercampaign