Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

ecommerce with custom dimension #5

Open
gondo opened this issue Jul 1, 2014 · 0 comments
Open

ecommerce with custom dimension #5

gondo opened this issue Jul 1, 2014 · 0 comments

Comments

@gondo
Copy link

gondo commented Jul 1, 2014

i have problem tracking my custom dimension (payment type in my case).
my code looks like this, but it doesnt work:

    // GA loader
    ga('create', '{{ ga_tracking }}', 'auto', {
        'allowLinker': true
    });
    ga('require', 'displayfeatures');
    ga('require', 'linker');
    ga('linker:autoLink', ['domain1.com', 'domain2.com']);

    ga('set', 'dimension1', 'credit card');
    ga('require', 'ecommerce', 'ecommerce.js');
    ga('ecommerce:addTransaction', {
        'id': '123',
        'revenue': '100',
        'currency': 'XY'
    });
    ga('ecommerce:addItem', {
        'id': '123',
        'name': 'Package 1',
        'sku': '1',
        'category': 'Cat 1',
        'price': '100',
        'quantity': '1'
    });
    ga('ecommerce:send');

    ga('send', 'pageview');

i dont know where and how to send my custom dimension.
should it be part of pageview hit? or should it be part of ecommerce:send? if 2nd than how to set the dimension to belong to ecommerce:send?

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

No branches or pull requests

1 participant