Skip to content
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

feat(gatsby-plugin-google-tagmanager): add option for selfHostedOrigin #32733

Merged
merged 8 commits into from
Aug 30, 2021

Conversation

tackaberry
Copy link
Contributor

@tackaberry tackaberry commented Aug 9, 2021

Description

In the gatsby-plugin-google-tagmanager, this change supports variable selfHostedOrigin, defaulting to googletagmanager.com.

With the advent of Server Side Tagging, we have the ability to serve gtm.js from "self-hosted" tagging server.
See: https://developers.google.com/tag-manager/serverside
And: https://developers.google.com/tag-manager/serverside/send-data#update_the_gtmjs_source_domain

Thus the base url, instead of googletagmanager.com could be sst.example.com or analytics.example.com.

Follow up to discussion: #32719

With selfHostedOrigin: 'https://sst.example.com':
Screen Shot 2021-08-08 at 9 05 54 PM

Screen Shot 2021-08-08 at 9 06 05 PM

Default:

Screen Shot 2021-08-08 at 9 07 55 PM

Screen Shot 2021-08-08 at 9 08 08 PM

Documentation

There is a related change to the README in the package.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 9, 2021
Brett Tackaberry and others added 2 commits August 8, 2021 21:27
@tackaberry
Copy link
Contributor Author

@wardpeet Can you help determine why the tests aren't passing? I can't decipher any reasons why this is being stopped.

Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

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

Can you add tests as well? You also have to make it a little bit more robust so origin never ends with a /.

You can skip pnp test for now.

@tackaberry
Copy link
Contributor Author

@wardpeet thanks for the notes. Tests added, and change changed.

Screen Shot 2021-08-09 at 8 14 35 PM

@tackaberry
Copy link
Contributor Author

hey there @wardpeet - Im curious about the process from here- I'd like to get this feature in use as a plugin if we can. Anything else I can do to push this forward?

@wardpeet
Copy link
Contributor

Hey @tackaberry, sorry this was forgotten on my end. I've updated the branch with latest master and will go over it one last time and merge.

@wardpeet wardpeet added topic: plugins-analytics Various analytics plugins like gatsby-plugin-google-analytics type: feature or enhancement Issue that is not a bug and requests the addition of a new feature or enhancement. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 27, 2021
@wardpeet wardpeet added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Aug 27, 2021
@tackaberry
Copy link
Contributor Author

Great. Thanks for merging in master. Anything I have to do at this point? How long typically until it gets merged in and available in the release?

@wardpeet wardpeet changed the title gatsby-plugin-google-tagmanager / variable selfHostedOrigin for googletagmanager.com feat(gatsby-plugin-google-tagmanager): add option for selfHostedOrigin Aug 30, 2021
@wardpeet wardpeet merged commit ed72e68 into gatsbyjs:master Aug 30, 2021
@wardpeet
Copy link
Contributor

@tackaberry normally only a day when things are good to go. We publish it under the @next tag. So you can play with it with npm install gatsby-plugin-google-tagmanager@next. I'll comment when it's released

pragmaticpat pushed a commit to pragmaticpat/gatsby that referenced this pull request Apr 28, 2022
gatsbyjs#32733)

In the gatsby-plugin-google-tagmanager, this change supports variable selfHostedOrigin, defaulting to googletagmanager.com.

With the advent of Server Side Tagging, we have the ability to serve gtm.js from "self-hosted" tagging server.
See: developers.google.com/tag-manager/serverside
And: developers.google.com/tag-manager/serverside/send-data#update_the_gtmjs_source_domain

Co-authored-by: Ward Peeters <ward@coding-tech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes topic: plugins-analytics Various analytics plugins like gatsby-plugin-google-analytics type: feature or enhancement Issue that is not a bug and requests the addition of a new feature or enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants