ユニバーサルアナリティクスの新トラッキングコード、メソッド一覧まとめ

ユニバーサルアナリティクスのメソッド一覧

とりあえずまとめました。

あくまで自分用メモとしてまとめました。詳しくは以下にすべて書いてありますので、ご参照下さい。

>>Analytics.js Field Reference – Google Analytics — Google Developers

この記事の目次

create系

ga(‘create’, ‘UA-XXXX-Y’, {‘name’: ‘myTracker’});
ga(‘create’, ‘UA-XXXX-Y’, {‘clientId’: ‘35009a79-1a05-49d7-b876-2b884d0f825b’});
ga(‘create’, ‘UA-XXXX-Y’, {‘userId’: ‘as8eknlll’});
ga(‘create’, ‘UA-XXXX-Y’, {‘sampleRate’: 5});
ga(‘create’, ‘UA-XXXX-Y’, {‘siteSpeedSampleRate’: 50});
ga(‘create’, ‘UA-XXXX-Y’, {‘alwaysSendReferrer’: true});
ga(‘create’, ‘UA-XXXX-Y’, {‘allowAnchor’: false});
ga(‘create’, ‘UA-XXXX-Y’, {‘cookieName’: ‘gaCookie’});
ga(‘create’, ‘UA-XXXX-Y’, {‘cookieDomain’: ‘example.com’});
ga(‘create’, ‘UA-XXXX-Y’, {‘cookieExpires’: 86400});
ga(‘create’, ‘UA-XXXX-Y’, {‘legacyCookieDomain’: ‘store.example.com’});

set系

ga(‘set’, ‘anonymizeIp’, true);
ga(‘set’, ‘forceSSL’, true);
ga(‘set’, ‘referrer’, ‘http://example.com’);
ga(‘set’, ‘campaignName’, ‘(direct)’);
ga(‘set’, ‘campaignSource’, ‘(direct)’);
ga(‘set’, ‘campaignMedium’, ‘organic’);
ga(‘set’, ‘campaignKeyword’, ‘Blue Shoes’);
ga(‘set’, ‘campaignContent’, ‘content’);
ga(‘set’, ‘campaignId’, ‘ID’);
ga(‘set’, ‘screenResolution’, ‘800×600’);
ga(‘set’, ‘viewportSize’, ‘123×456’);
ga(‘set’, ‘encoding’, ‘UTF-16’);
ga(‘set’, ‘screenColors’, ‘8-bit’);
ga(‘set’, ‘language’, ‘en-us’);
ga(‘set’, ‘javaEnabled’, true);
ga(‘set’, ‘flashVersion’, ’10 1 r103′);
ga(‘set’, ‘nonInteraction’, true);
ga(‘set’, ‘location’, ‘http://foo.com/home?a=b’);
ga(‘set’, ‘hostname’, ‘foo.com’);
ga(‘set’, ‘page’, ‘/foo’);
ga(‘set’, ‘title’, ‘Settings’);
ga(‘set’, ‘screenName’, ‘High Scores’);
ga(‘set’, ‘&linkid’, ‘html-element-id’);
ga(‘set’, ‘appName’, ‘My App’);
ga(‘set’, ‘appId’, ‘com.company.app’);
ga(‘set’, ‘appVersion’, ‘1.2’);
ga(‘set’, ‘appInstallerId’, ‘com.platform.vending’);
ga(‘set’, ‘dimension14’, ‘Sports’);
ga(‘set’, ‘metric7’, 47);
ga(‘set’, ‘expId’, ‘Qp0gahJ3RAO3DJ18b0XoUQ’);
ga(‘set’, ‘expVar’, ‘1’);

send系

ga(‘send’, {‘hitType’: ‘pageview’,’page’: ‘/home’});
ga(‘send’, ‘pageview’, {‘hitCallback’: function() {alert(‘hit sent’);}});
ga(‘send’, ‘pageview’, {‘sessionControl’: ‘start’});
ga(‘send’, ‘event’, {‘eventCategory’: ‘Category’,’eventAction’: ‘Action’});
ga(‘send’, ‘event’, {‘eventCategory’: ‘Category’,’eventAction’: ‘Action’});
ga(‘send’, ‘event’, {‘eventCategory’: ‘Category’,’eventAction’: ‘Action’,’eventLabel’: ‘Label’});
ga(‘send’, ‘event’, {‘eventCategory’: ‘Category’,’eventAction’: ‘Action’,’eventValue’: 55});
ga(‘send’, ‘social’, {‘socialNetwork’: ‘facebook’,’socialAction’: ‘like’,’socialTarget’: ‘http://foo.com’})
ga(‘send’, ‘social’, {‘socialNetwork’: ‘facebook’,’socialAction’: ‘like’,’socialTarget’: ‘http://foo.com’})
ga(‘send’, ‘social’, {‘socialNetwork’: ‘facebook’,’socialAction’: ‘like’,’socialTarget’: ‘http://foo.com’})
ga(‘send’, ‘timing’, {‘timingCategory’: ‘category’,’timingVar’: ‘lookup’,’timingValue’: 123});
ga(‘send’, ‘timing’, {‘timingCategory’: ‘category’,’timingVar’: ‘lookup’,’timingValue’: 123});
ga(‘send’, ‘timing’, {timingCategory’: ‘category’,timingVar’: ‘lookup’,timingValue’: 123});
ga(‘send’, ‘timing’, {timingCategory’: ‘category’,timingVar’: ‘lookup’,timingValue’: 123,timingLabel’: ‘label’});
ga(‘send’, ‘exception’, {exDescription’: ‘DatabaseError’});
ga(‘send’, ‘exception’, {exFatal’: true});

・ ・ ・ ・ ・

>>安っ!アマゾンで半額以下になっている食品タイムセール
セール特設ページを見る

↓↓↓無料のニュースレターを配信中です

解像度とかも変えられる。