Integrating the Freshmarketer JS Code on a site using Google Tag Manager involves few easy steps. This article guides you through the integration process.
NOTE: Google Tag Manager doesn’t support synchronous code. Hence, the integration is done using Asynchronous code.
Login to Freshmarketer account. From the Freshmarketer dashboard, navigate to Project Settings -> Integrations.
In the Integrations tab, from the list of available options, enable Google Tag Manager integration.
A pop-up appears asking users to confirm integrating with GTM as GTM might cause page flickering during AB testing. Click Yes to proceed. Read this article to know more about the asynchronous script and page flickering effect.
In the page that appears, choose a Google account for which the goals have to be imported.
NOTE: To change the account, disable the Google Tag Manager integration. It logs out of the existing account. Enable it again to select the account.
Click Allow button to accept and grant the required permissions in the Google Permissions page.
A pop-up appears with the list of GTM accounts linked to the selected Google account. Select a particular GTM account and click Next to proceed.
Now, select a container from the list of containers associated with the selected GTM account and click Save & Close.
Now, in the GTM, click the respective container. In the page that opens, under Workspace tab, click Tags in the left pane. Freshmarketer tag will be present in the right pane. The Freshmarketer tag will be named with a prefix Freshmarketer-AsyncJS_Code followed by the OrgId.
Click on the Freshmarketer tag below the Name column to see Freshmarketert’s Asynchronous code added. The triggering is set as All Pages by default.
NOTE: If the GTM container code is not installed in the site, navigate to Admin -> Install Google Tag Manager. Copy the code and paste it onto the native code of the necessary pages in the site.