Skip to content

Commit

Permalink
Enable _ga cookie for googleanalytics, doubleclick and adsense. (#9586)
Browse files Browse the repository at this point in the history
* Enable _ga cookie for googleanalytics, doubleclick and adsense.

* fix test
  • Loading branch information
lannka committed May 27, 2017
1 parent d4dfdf1 commit 93ed7b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 2 additions & 0 deletions ads/_config.js
Expand Up @@ -111,6 +111,7 @@ export const adConfig = {
prefetch: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',
preconnect: 'https://googleads.g.doubleclick.net',
clientIdScope: 'AMP_ECID_GOOGLE',
clientIdCookieName: '_ga',
},

adsnative: {
Expand Down Expand Up @@ -273,6 +274,7 @@ export const adConfig = {
'https://tpc.googlesyndication.com',
],
clientIdScope: 'AMP_ECID_GOOGLE',
clientIdCookieName: '_ga',
renderStartImplemented: true,
},

Expand Down
7 changes: 1 addition & 6 deletions extensions/amp-analytics/0.1/test/test-vendors.js
Expand Up @@ -17,13 +17,8 @@
import {ANALYTICS_CONFIG} from '../vendors';

describe('analyaitcs vendors', () => {
it('googleanalytics & googleanalytics-alpha should be identical, ' +
'expect the Client ID cookie name', () => {
it('googleanalytics & googleanalytics-alpha should be identical', () => {
const gaConfig = ANALYTICS_CONFIG['googleanalytics'];
expect(gaConfig).not.to
.deep.equal(ANALYTICS_CONFIG['googleanalytics-alpha']);

gaConfig.vars.clientId = 'CLIENT_ID(AMP_ECID_GOOGLE,,_ga)';
expect(gaConfig).to
.deep.equal(ANALYTICS_CONFIG['googleanalytics-alpha']);
});
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-analytics/0.1/vendors.js
Expand Up @@ -559,7 +559,7 @@ export const ANALYTICS_CONFIG = /** @type {!JSONType} */ ({
'vars': {
'eventValue': '0',
'documentLocation': 'SOURCE_URL',
'clientId': 'CLIENT_ID(AMP_ECID_GOOGLE)',
'clientId': 'CLIENT_ID(AMP_ECID_GOOGLE,,_ga)',
'dataSource': 'AMP',
'anonymizeIP': 'aip',
},
Expand Down

0 comments on commit 93ed7b6

Please sign in to comment.