Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event variables storage on GTM side #10

Open
jonystorm opened this issue Jun 5, 2015 · 3 comments
Open

Event variables storage on GTM side #10

jonystorm opened this issue Jun 5, 2015 · 3 comments

Comments

@jonystorm
Copy link

Hi @kraihn , I manage to get everything working since last time, I'm getting hits on GA smoothly. The only thing I haven't been able to do is to get GTM to pass the different event information to GA.

I believe that I need to create a Data Layer variable to configure the event tracking params (fields: category, action, label and value) since if I set those values with a fixed string that's the value it sends to GA, and I need those to be what I'm sending from my app with "trackEvent" function.

So, I tried to create Data Layer variables with the data layer variable name as the params of your function are called, but it doesn't work, could it be that they are named different when being sent to GTM? or am I missing something else here?

I know this may not be an issue with your plugin but it's the only source I've got left to check on.

Thanks,
Jonatan

@MikeBateman
Copy link

+1 I'm also unable to access the dataLayer object, even if i create it myself it doesn't seem to work?

@kraihn
Copy link
Owner

kraihn commented Jul 8, 2015

@jonystorm, the Data Layer variables aren't the same as the parameter names. For example, the Data Layer name for the event label property is "target-properties". This is because I built this plugin against an existing Analytics plugin for AngularJS that named it's properties differently. I've added a Wiki page with the expected Data Variables, and how to tie them to pageview and event tracking. You will need to create the Marcos, Rules and Tags manually to get full results.

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

@kraihn
Copy link
Owner

kraihn commented Jul 8, 2015

@MikeBateman, the Data Layer isn't directly accessible from JS. Only the two specific methods are available at this time. It would be a nice feature in the future to allow custom modifications to the Data Layer, but my current application doesn't have the need for it. I would be open to a pull request for it if you have the need and capacity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants