Google Tag Manager

Implementation of Google Tag Manager For Salesforce Communities

Introduction

Without depending upon the developer, your marketing team can deploy marketing tags and tracking pixels. Google Tag Manager gives you permission to track video views, form inputs, scrolling, events, and many other factors that can tell what users are doing in your community with the functionality provided by you. This will help you in understanding how the functionality provided by you is helping the users for better understanding and whatever the actions they wanted to do is completing quicker and easier.

One of the most common challenges faced is whenever we are integrating Salesforce with Google Tag Manager, the configuration is required on both sides to integrate them in order to function properly.

I will show you step-by-step to configure Google Tag Manager and Salesforce Community Builder in order to successfully setup integration between both of them.

dont miss out iconDon't forget to check out: Salesforce Lightning:map - Show Locations on Google Map

Step 1: Get GTM Tracking Script

  1. To do that firstly, create a new Google Tag Manager for your Salesforce Community.
  2. Login to Google Tag Manager.
  3. Create an account and web container for your Salesforce community if not created already.
  4. Now generate the Tracking Javascript code for later use in Salesforce Community.  
  5. Go to the container you have created for your Salesforce Community.
  6. Click the code prefixing with “GTM-”.
  7. Now copy the Tracking Javascript code for later use in Salesforce Community.

Step 2: Setup Google Tag Manager

  1. For the Setup of Google Tag Manager, configure triggers because there are certain events such as page views, HTML element clicks when to fire them can only be known in Salesforce Community Web App.
  2. In Google Tag Manager, you will find Triggers in the left menu.
  3. When finished configuring Google Tag Manager triggers, next you will configure tags.
  4. Configuring tags provides flexibility for custom tags or any third party tags for the implementation of code.
  5. If you want any tag to be fired, configure the minimum of one trigger for a tag.

Step 3: Setup Content Security Policies and Trusted Sites in

Salesforce Community Builder

  1. If Content Security Policies in Community Builder are not properly configured, might be some functions of Google Tag Manager do not properly work.
  2. Now giving you the steps for setting up.
  3. In the same browsing session, Click Settings and then security.
  4. From the picklist of Script Security Level, pick Allow Inline Scripts and Script Access to Whitelisted Third-Party Hosts.

dont miss out iconCheck out another amazing blog by Deepak here: Requirements for Approval Process in Salesforce - All You Need to Know

Step 4: Set Google Tag Manager script to Salesforce Community

  1. Under Settings, Click on Advanced.
  2. You can paste your Google Analytics Tracking Id here.
  3. Under heading Head Markup, click on Edit Head Markup and paste the Google Tag Manager Tracking Script Code, you obtained in Step1.
  4. Click save and now you can publish to the community.

Finally, you can also test and debug whether Google Tag Manager which you have implemented is properly working or not. To do that Log into your account, then Preview mode on, then access the Salesforce Community within the same browsing session.

Conclusion

If you have followed all the steps, then not only have you successfully implemented Google Tag Manager integration but also able to track various events as we discussed earlier.

Responses

Popular Salesforce Blogs