Skip to content

misc(treemap): add GA snippet for new property#12481

Merged
connorjclark merged 1 commit into
masterfrom
treemap-ga
May 14, 2021
Merged

misc(treemap): add GA snippet for new property#12481
connorjclark merged 1 commit into
masterfrom
treemap-ga

Conversation

@connorjclark

@connorjclark connorjclark commented May 14, 2021

Copy link
Copy Markdown
Collaborator

Just tracking page views for now.

ref #11254

@connorjclark connorjclark requested a review from a team as a code owner May 14, 2021 21:36
@connorjclark connorjclark requested review from patrickhulce and removed request for a team May 14, 2021 21:36
@google-cla google-cla Bot added the cla: yes label May 14, 2021

<!-- Google Analytics -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-16X003MB7V"></script>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢

function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

ga('create', 'UA-85519014-2', 'auto');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just change the property descriptor? analytics still documents this approach and I'd hate to not follow our own aspirational advice

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, and the different prefix in the identifier makes me think twice about doing that.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so GA 4 isn't as bad as I thought

good news: stopped doing the double script hop, so gtag is the only script loaded to fire GA events
bad news: the script is 140% larger and increases TBT 385% more (granted GA only contributes ~5ms with the original so quintupling only gives you ~25ms, but hey I'm still a little salty 😉 )

function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

ga('create', 'UA-85519014-2', 'auto');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@connorjclark connorjclark merged commit 4d4f31e into master May 14, 2021
@connorjclark connorjclark deleted the treemap-ga branch May 14, 2021 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants