Below are GTM templates that you can download and import in your GTM (how-to described in sections below) to get you started. You can consult with your Bloomreach representative as to which you should download/use.

The Tags and Variables will be delivered in a single JSON file that you can import into your GTM console. You can start from the template files below:

Replace accountId value in the JSON file

Find _5014_ and replace it with your corresponding account ID. You can find your account ID from the account package received, or you can consult with your Bloomreach representative.

Using the GTM Templates

The GTM template files require you to insert your correct Bloomreach values (account id, domain\_key, view\_id) as needed. Additionally, the variables within the template need to be mapped to the variables you have in GTM. Importing the template without configuring these variables will not result in a working pixel.

It will be your responsibility to do the following:

  • For each Bloomreach tag, associate the proper triggers needed for the tag specification as provided in the tag's notes section.

  • For each Bloomreach variable, configure the variable's type and definition to return data that matches our specification provided in the variable's notes section.

The Step-by-Step Guide below assumes that:

  • You already have a GTM account and a container published on your website.

  • You have edit permissions to the container you wish to implement against.

If you need further help, please see the [main pixel specification](🔗) or consult with your Bloomreach representative. 

### Step 1: Import Bloomreach tags/variables into your container

Your Bloomreach representative has created a JSON file that you can import into your GTM container. You can then modify the container triggers, variables, and rules as needed. You should also refer to [Google's documentation](🔗) to make your changes.

All Bloomreach items are prefixed with "Bloomreach" and are unlikely to conflict with existing items on your site. The items are categorized into folders prefixed with Bloomreach to help keep your container organized.

The name of the file follows the format **BLOOMREACH-GTM-{{ACCT_ID}}-v1.json**.

  1. Sign in to your Google Tag Manager Account.

  2. Select the container you wish to implement our pixels with.

  3. Select the **Admin** tab to navigate to the account and container settings page.

  4. In the container settings column, select **Import Container**.

  5. Click the **Choose Container File** button and select your provided JSON file (BLOOMREACH-GTM-{{ACCT_ID}}-v1.json).

  6. Select **New** workspace, name it Bloomreach Pixel Init, provide an optional description, and click **Save**.

  7. \[IMPORTANT\] Select **Merge** as the import option and then **Rename** conflicting tags, triggers, and variables. The imported items are scoped with Bloomreach names and it's highly unlikely you'll encounter naming conflicts.

  8. Preview, Verify, and then Confirm the import.

The Import Settings will look similar to image below, right before you confirm the import.


### Step 2: Configure Bloomreach Tag Triggers

All Bloomreach tags, except Bloomreach PageView are added without an associated trigger. You need to add triggers to each of the remaining tags based on how your site is configured.

If your GTM container doesn't have an existing Trigger that satisfies the criteria for firing the Bloomreach tag, you will need to setup a new Trigger.

  1. Navigate to Bloomreach Pixel Init workspace.

  2. Select Tags left-hand navigation item.

  3. Select the first Bloomreach tag.

  4. Use the Notes section to understand when you should fire this tag on your site (e.g. when a user clicks on the add to cart button)

  5. If you have an existing Trigger in GTM that satisfies the criteria, select Choose a trigger to make this tag fire and select from list of existing. If you do not have an existing Trigger, create one with the + icon.

  6. Repeat steps 4-5 for each remaining BloomReach tag until all tags have triggers.

Bloomreach Tags will look similar to below after triggers are added:


### Step 3: Configure Bloomreach Variables

At this point your tags will fire; however, they will be missing required data. You still need to configure each individual Bloomreach Variable.


On initial import, each Bloomreach Variable has been imported with a default variable type and setting for illustration purposes. Out of the box, none of the variables will resolve properly until they are configured according to how your site and GTM container is setup.

  1. Navigate to **Bloomreach Pixel** Init workspace.

  2. Select **Variables** left-hand navigation item.

  3. Select the first **Bloomreach Variable**.

  4. Use the **Notes** section to understand how to configure what type of GTM variable to use to.

  5. Select **Variable Type** and select the appropriate type from list. Commonly used ones will be **Data Layer Variable****JS Variable**, and **Custom JavaScript**.

  6. Configure the variable such that when it is evaluated, it will return the type and format expected.

  7. Click **Save**.

**Note**: For integrating pixel using Google Tag Manager, we don’t have a _checkout/conversion_ event. We have a _pageview_ event that requires conversion data to be passed in at the time of the pageview. In the _pageview_ event, we have a parameter called **`'is_conversion'`**. For the Checkout Confirmation page(right after checkout), set the value of **`'is_conversion'`** parameter to "1". For the rest of the checkout process pages, set the value of **`'is_conversion'`** parameter to "0".

### Step 4: Verify Pixel Implementation

  1. Deploy Container to your development environment or use the preview functionality of GTM to simulate your Bloomreach Pixel work.

  2. Use the Bloomreach [Chrome Extension Pixel Validator](🔗) to verify each tag.

  3. If you have any validation issues, please update GTM container appropriately to resolve.

  4. Notify your Bloomreach representative that container is deployed on staging.

### Step 5: Publish

When you are confident your container is passing all validations and is ready to be deployed to production, publish your Bloomreach Pixel Init workspace to your production environment and notify your Bloomreach representative.

### Step 6: Pixel Validation

The final step of the setup is to test your pixel configuration scenarios. Please follow the Bloomreach Pixel validation guidelines to ensure that your Bloomreach Pixel fires as expected.