edrian
edrian

Reputation: 4531

Cordova google tag manager (GTM) - can't see hits on analytics

I'm having problems integrating cordova-plugin-tag-manager. I've installed plugin and configured GTM ID in project. Success and Error callbacks seems to be working on android (I've debugged with LogCat), I'm having response from GTM, but can't see hits on analytics realtime report.

Upvotes: 0

Views: 929

Answers (1)

edrian
edrian

Reputation: 4531

I've found a solution. You must configure GTM tags like said in this plugin wiki page to have hits on analytics report:

https://github.com/kraihn/cordova-plugin-tag-manager/wiki/GTM-Setup

Setup listeners in Google Tag Manager

6 User-Defined Variables

  • Variable Name: page path Variable Type: Data Layer Variable Data Layer Variable Name: content-name
  • Variable Name: event category Variable Type: Data Layer Variable Data Layer Variable Name: target
  • Variable Name: event action Variable Type: Data Layer Variable Data Layer Variable Name: action
  • Variable Name: event label Variable Type: Data Layer Variable Data Layer Variable Name: target-properties
  • Variable Name: event value Variable Type: Data Layer Variable Data Layer Variable Name: value
  • Variable Name: event interaction type Variable Type: Data Layer Variable Data Layer Variable Name: interaction-type

2 Triggers

  • Trigger Name: events, Choose Event: Custom, Fire On: {{event}} equals interaction
  • Trigger Name: pageviews, Choose Event: Custom, Fire On: {{event}} equals content-view

2 Tags

  • Tag Name: Events, Tag Type: Universal Analytics, Tracking ID: YourGoogleAnalyticsID, Track Type: Event, Category: {{event category}}, Action: {{event action}}, Label: {{event label}}, Value: {{event value}} Fields to Set: appName = {{App Name}}, appVersion = {{App Version Code}}, screenName = {{page path}}, Firing On: events

  • Tag Name: Pageviews, Tag Type: Universal Analytics, Tracking ID: YourGoogleAnalyticsID, Track Type: App View, Fields to Set: appName = {{App Name}}, appVersion = {{App Version Code}}, screenName = {{page path}}, Firing On: pageviews

Upvotes: 1

Related Questions