Bare in mind, this is just an example of how we could set up these events. You can use any other naming conventions when setting up the events in GTM. Full list of events that we send to GTM, with their data, can be found here: https://wiki.advbet.com/admin/online-platform-cms/google-events?s[]=slipbuy ====== Setting up the GTM events flow to GA ====== - Need to set up variables (see Data layer variables set up section) - Set up the triggers (see Set up triggers section) - Set up tags (see Set up tags section) ====== Data layer variables set up ====== These Data layer variables are used to pass data that comes from our app and are mapped within the GTM ecosystem to pass data to GA. === Action === {{:online:gtm:custom_variable_action.jpg|}} === Category === {{:online:gtm:custom_variable_category.jpg|}} === Label === {{:online:gtm:custom_variable_label.jpg|}} === Value === {{:online:gtm:custom_variable_value.jpg|}} === Content view name === *This data layer value allows to track pageviews in GA {{:online:gtm:custom_variable_content_view_name.jpg|}} ==== Set up triggers ==== To set up a trigger, we need to use the event name from the Events section. This is how login event looks after we finish the set up: {{:online:gtm:trigger_login.jpg|}} To receive all events from our app, we need to create triggers for all events from the Events table. === Routing trigger === Additionally to all triggers, we can set up routing trigger, to track pageviews in GA. The set up for this trigger should look like this: {{:online:gtm:trigger_content_view.jpg|}} ==== Set up tags ==== All of the events mentioned in Events section should be set up according to the example below: {{:online:gtm:tag_slip_buy.jpg|}} === slipBuy event tag example === The event according to the table in the Events section sends Category, Action and Label data. So in this case: - Choose Tag Type, which in our case is Google Analytics - We pick Category, Action and Label Data Layer Variables and insert them into the Event Tracking Parameters section. - Use {{ Google Analytics Settings }} in Google Analytics Settings sections - Assign previously created 'Slip buy' event trigger (as seen in the screenshot above, Triggering section) * Tag data should be set up according to the Events table. For instance, if event does not send Label data, we should leave Label field empty. Same goes for other fields. === Example of how we map custom variables with Tag fields === {{:online:gtm:tag_slip_buy_with_data_layer_variables.jpg|}} Once the tag is created correctly, it should start sending data to Google Analytics. ==== Router Tag example (pageview tracking) ==== Router tag is set up a bit differently from other events, and the tag set up should look like the one below: {{:online:gtm:tag_router.jpg|}} ==== Events ==== ^ Event name ^ Category ^ Action ^ Label ^ Value ^ | registrationInit | YES | YES | NO | NO | | registrationConfirmationKey | YES | YES | NO | NO | | registrationFinished | YES | YES | NO | NO | | login| YES | YES | NO | NO | | logout| YES | YES | NO | NO | | slipBuy | YES | YES | YES | NO | | depositSuccess | YES | YES | YES | YES | | withdrawalSuccess | YES | YES | YES | YES | | myAccountMenuDepositButtonClick | YES | YES | YES | YES |