Setting up custom tags for proprietary platforms in Google Tag Manager (GTM) allows you to extend GTM’s functionality and integrate with services not natively supported. This involves creating custom HTML tags or custom templates to send data to your proprietary platform. Here’s a comprehensive guide to help you set up custom tags in GTM.
Table of Contents
Toggle1. Understanding Your Proprietary Platform’s Requirements
- API Documentation:
- Review the API documentation of your proprietary platform to understand how data needs to be formatted and sent. Note any specific parameters, endpoints, and authentication methods required.
- Data Points:
- Identify the data points you need to send from your website to the proprietary platform. These could include user interactions, form submissions, page views, etc.
2. Create a Custom HTML Tag
- Log into GTM:
- Access your Google Tag Manager account at tagmanager.google.com and select the appropriate container.
- Add a New Tag:
- Click on Tags in the left-hand menu.
- Click on New to create a new tag.
- Configure Tag Type:
- Name your tag (e.g., “Custom Proprietary Platform Tag”).
- Click on Tag Configuration and select Custom HTML.
- Write Custom HTML:
- In the Custom HTML field, write the JavaScript code that sends data to your proprietary platform. Use the API endpoint and parameters identified earlier.
Replace the placeholder values with actual data points and API details from your proprietar platform.
5. Add Trigger:
-
-
- Click on Triggering and choose an appropriate trigger that determines when the custom tag should fire (e.g., Page View, Click, Form Submission).
- Create a new trigger if necessary.
-
- Save Tag:
- Click Save to save your custom tag.
3. Create Custom Templates (Optional)
- Use Custom Templates for Reusability:
- Custom templates provide a more user-friendly way to manage and reuse custom tags. They allow you to define the tag configuration using fields and settings that can be easily adjusted without editing code directly.
- Create a New Tag Template:
- In GTM, click on Templates in the left-hand menu.
- Under Tag Templates, click on New and then Start Building.
- Define Fields and Permissions:
- Add fields for all the configurable parameters (e.g., API endpoint, data points).
- Define permissions to specify what the template can do (e.g., send HTTP requests).
- Write Template Code:
- Use the Code tab to write the JavaScript that will execute the tag. Utilize the fields you defined for dynamic configuration.
- Save Template:
- Click Save to save the custom template.
- Now, you can use this template to create new tags with a user-friendly interface.
4. Test and Debug
- Preview Mode:
- Click on Preview in the top right corner of the GTM interface to enter preview mode. This allows you to test your tags without publishing changes.
- Check Tag Firing:
- Navigate to your website and trigger the conditions for your custom tag. Use the GTM debug panel to verify that the tag fires correctly.
- Inspect Network Requests:
- Use browser developer tools (usually found under the Network tab) to inspect the outgoing HTTP requests. Ensure the data is being sent correctly to the proprietary platform.
- Log and Troubleshoot:
- Add console logs in your custom HTML or template code to help with debugging. Check the browser console for any errors or messages indicating success or failure.
5. Publish Changes
- Review Changes:
- Once testing is successful, exit preview mode and review the changes in the GTM workspace.
- Publish Container:
- Click Submit to publish the changes to your GTM container. Provide a descriptive version name and summary of changes for reference.
Example Scenario
Scenario: A proprietary CRM platform requires tracking user interactions on a website.
- Identify Data Points:
- Identify key interactions to track, such as form submissions and button clicks.
- Create Custom HTML Tag:
- Write a custom HTML tag to send interaction data to the CRM’s API endpoint.
- Test and Debug:
- Use GTM’s preview mode to ensure the tag fires correctly when the button is clicked.
- Publish:
- Once confirmed, publish the container to make the changes live.
Implementing custom tags for proprietary platforms in Google Tag Manager involves creating custom HTML tags or custom templates to handle the specific data collection and transmission needs. By understanding your platform’s API requirements, configuring GTM properly, and thoroughly testing your implementation, you can successfully integrate proprietary tracking solutions into your GTM setup. This approach enhances the flexibility and power of your tag management.
