Google Tag Manager is a tool that enables you to install, store, and manage tags.
Go to siteThe Google Tag Manager API allows you to manage your tags, triggers, variables, and related configurations programmatically. Through Pipedream, you can integrate these API capabilities into serverless workflows to automate complex tagging tasks, sync configurations across environments, and streamline marketing or analytics operations. Pipedream's platform facilitates the creation of custom automations with Google Tag Manager, helping you deploy tags faster, manage user permissions, and control versions of your tag configurations.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
google_tag_manager: {
type: "app",
app: "google_tag_manager",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://www.googleapis.com/tagmanager/v2/accounts`,
headers: {
Authorization: `Bearer ${this.google_tag_manager.$auth.oauth_access_token}`,
},
})
},
})
Automated Tag Deployment: Build a workflow that listens for new product additions in your e-commerce platform, such as Shopify, and automatically creates and deploys corresponding tags in Google Tag Manager to track product performance.
Sync Configurations Across Environments: Set up a Pipedream workflow that syncs tag configurations between staging and production environments in Google Tag Manager. Whenever a tag is updated or published in staging, the same changes can be applied to production automatically.
User Access Management: Create a workflow that automates the process of managing user permissions in Google Tag Manager. When a new team member is added to your project management tool, like Jira or Asana, the workflow can grant them the appropriate level of access in Google Tag Manager. .
Google Tag Manager uses OAuth authentication. When you connect your Google Tag Manager account, Pipedream will open a popup window where you can sign into Google Tag Manager and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Google Tag Manager API.
Pipedream requests the following authorization scopes when you connect your account:
email
profile
https://www.googleapis.com/auth/tagmanager.readonly
https://www.googleapis.com/auth/tagmanager.edit.containers
https://www.googleapis.com/auth/tagmanager.publish
GET
https://accounts.google.com/o/oauth2/auth
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
&
prompt=consent
&
access_type=offline
POST
https://oauth2.googleapis.com/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://oauth2.googleapis.com/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}