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

Have GA set the same client ID as in non-AMP #5761

Closed
jasti opened this Issue Oct 21, 2016 · 2 comments

Comments

@jasti
Collaborator

jasti commented Oct 21, 2016

Right now, GA sets the client ID as GA1.N.MMM.MMM (when loading AMP page from publisher domain) which is measured as a user being bounced even though the user lands on the same domain. This is because GA sets the client ID as MMM.MMM on non-AMP pages.

Note that this is only applies to the case when using below in the GA config.
'vars': {
'clientId': 'CLIENT_ID(_ga)',
},

CC @rudygalfi

@rudygalfi rudygalfi added this to the Pending 3P Implementation milestone Oct 21, 2016

@lannka lannka added this to Sprint Candidate in Analytics Mar 13, 2017

@lannka lannka assigned lannka and unassigned avimehta Mar 13, 2017

@lannka lannka modified the milestones: Sprint H2 March, Pending 3P Implementation Mar 13, 2017

@lannka

This comment has been minimized.

Show comment
Hide comment
@lannka

lannka Mar 13, 2017

Collaborator

To clarify, on non-AMP page, GA SDK writes _ga cookie in format of GA1.N.MMM.MMM, where MMM.MMM is the Client ID.

On AMP pages of the same publisher domain, amp-analytics writes AMP_ECDI_GOOGLE cookie in format of amp-NNNNNN, where the whole string is Client ID.

When user navigates from an AMP page to a non-AMP page on the same publisher domain, the user is counted twice.


Given the high priority of this bug, and that the "filter" support (#2198) hasn't landed yet, discussed with @dvoytenko, we'll go for a temporary fix first (hard code the logic to strip-off the leading prefix).

Let us know if any concerns. Meantime, we hope this eventually could be solved at GA server side, @avimehta

Collaborator

lannka commented Mar 13, 2017

To clarify, on non-AMP page, GA SDK writes _ga cookie in format of GA1.N.MMM.MMM, where MMM.MMM is the Client ID.

On AMP pages of the same publisher domain, amp-analytics writes AMP_ECDI_GOOGLE cookie in format of amp-NNNNNN, where the whole string is Client ID.

When user navigates from an AMP page to a non-AMP page on the same publisher domain, the user is counted twice.


Given the high priority of this bug, and that the "filter" support (#2198) hasn't landed yet, discussed with @dvoytenko, we'll go for a temporary fix first (hard code the logic to strip-off the leading prefix).

Let us know if any concerns. Meantime, we hope this eventually could be solved at GA server side, @avimehta

@lannka lannka referenced this issue Mar 13, 2017

Closed

Add filter support for analytics vars #2198

0 of 3 tasks complete

@jasti jasti added this to Sprint Candidate in AMP Advertising Mar 13, 2017

@jasti jasti changed the title from Have GA pass the same client ID as in non-AMP to Have GA set the same client ID as in non-AMP Mar 13, 2017

@1987yama3

This comment has been minimized.

Show comment
Hide comment
@1987yama3

1987yama3 Mar 16, 2017

Good!

However, you should match the definition to a strict clientID in Google Analytics.
In Google Analytics, the cookie is saved in the format of "GAa.b-c.dddddd.eeeee".
(the lower case letters of the alphabet are actually numbers. Besides, "-c" is mostly omitted.)

"GAa.b-c." is not strictly a client ID, but metadata when saving to a cookie.

Therefore, after retrieving the value from the cookie, you need to send the deleted "GAa.b-c." as ClientID.

1987yama3 commented Mar 16, 2017

Good!

However, you should match the definition to a strict clientID in Google Analytics.
In Google Analytics, the cookie is saved in the format of "GAa.b-c.dddddd.eeeee".
(the lower case letters of the alphabet are actually numbers. Besides, "-c" is mostly omitted.)

"GAa.b-c." is not strictly a client ID, but metadata when saving to a cookie.

Therefore, after retrieving the value from the cookie, you need to send the deleted "GAa.b-c." as ClientID.

@ampwafflebot ampwafflebot added in progress and removed Type: Bug labels Mar 22, 2017

@lannka lannka closed this in #8317 Mar 24, 2017

@jasti jasti moved this from Sprint Candidate to Done in AMP Advertising Mar 24, 2017

@rudygalfi rudygalfi moved this from Sprint Candidate to In Progress This Sprint in Analytics Mar 24, 2017

@rudygalfi rudygalfi moved this from In Progress This Sprint to Done in Analytics Mar 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment