▲Wirig Diagram Hot
▲ ▲ ▼

Blue Color Codes: Easy GTAG Integration

By

Discovering the perfect shade of blue for your website can indeed be a task, but it becomes a breeze with Google's Tag Manager (GTM). GTM allows you to manage and deploy site tags without Modify source code.

Among the numerous transformations it offers is the ability to manipulate page colors using GTM variables, thus affecting the user's visual experience. Let's explore the intricacies of altering your webpage's blue color codes using GTM.

Understanding Color Changing with GTM

The process involves using GTM variables to replace the standard CSS within the website's code. If you're not already familiar, let's introduce the key components: GTM variables, dataLayer, and dataLayer push.

Blue Canva Color Palette Chart 💙 | Trending Blue Hex Codes for Designers
Blue Canva Color Palette Chart 💙 | Trending Blue Hex Codes for Designers
150+ Shades of Blue Color with Names, Hex, RGB, and CMYK Codes
150+ Shades of Blue Color with Names, Hex, RGB, and CMYK Codes
40 Shades Of Blue Color Palette with Names, HEX, RGB, CMYK
40 Shades Of Blue Color Palette with Names, HEX, RGB, CMYK

To implement this, you'll need to have a firm grasp of these tools and how to use them in tandem to manipulate your page's color scheme.

GTM Variables: Your Colors at Your Fingertips

GTM Variables allow you to store and re-use information across different trigger rules. You can utilize the 'First Class Citations' variable type to push color codes into your GTM environment. This is particularly useful when dealing with hues like blue that have multiple possible HEX, RGB, or HSL equivalents.

Coastal Blue Colour Palette (Palette #77)
Coastal Blue Colour Palette (Palette #77)
Colors
Colors
the sky is filled with different types of clouds and blue skies are in the background
the sky is filled with different types of clouds and blue skies are in the background

For instance, you could create a variable for each color you want to change, such as {{Variable 1}} for your light blue, {{Variable 2}} for deep blue, {{Variable 3}} for navy, etc.

dataLayer: The Channel of Color Change

The dataLayer is a JavaScript object that you can push data into manually, using the gtag.push() method. It's crucial in GTM color manipulation when you want to instruct the GTM to fetch a specific color code for your page.

push method: ```javascript gtag('event', 'colorChange', { 'color': 'blue' });

Cobalt Blue Color: Hex Code, Palettes & Meaning | Figma
Cobalt Blue Color: Hex Code, Palettes & Meaning | Figma
Blue palate
Blue palate
blue color codes (with shades)
blue color codes (with shades)
Color Combinaisons: Palette for Graphic Design #43
Color Combinaisons: Palette for Graphic Design #43
shades of blue and green with the same color scheme in each section, including one that is
shades of blue and green with the same color scheme in each section, including one that is
the top ten blue and purple colors in each color scheme, with their respective names
the top ten blue and purple colors in each color scheme, with their respective names
```

When a 'colorChange' event is pushed into dataLayer, GTM can respond by triggering or saving it as a variable.

Implementing Color Change with GTM

Now that we understand the tools let's apply them. You will need to create a new Trigger in GTM to listen for the 'colorChange' event and a Variable to capture the 'color' value.

Configure that Trigger to fire when the 'colorChange' event is pushed into the dataLayer. The Variable you created should now have the value 'blue'. With this information, you can manipulate your site's CSS to implement these changes.

Shades of Blue Color Psychology – Meanings, Emotions & Hex Codes
Shades of Blue Color Psychology – Meanings, Emotions & Hex Codes

Changing Your Blue Color Codes with GTM

Let's say you want to change the color of a specific paragraph's text to a particular shade of blue. You could use the CSS Selector to identify the paragraph and set a new color value. To do this, your GTM Trigger might look like:

```javascript {{Trigger}}oplanet('css', {{Variable 1}}, 'paragraph', 'color', 'blue'); ```

You could use this method to change any CSS property - not just color - and for any HTML element on your page, not just paragraphs.

Remember, every website is unique, so you may need to experiment with different selectors and properties to achieve your desired result. But armed with the knowledge of how to manipulate color codes with GTM, you are now ready to revolutionize your website's aesthetics with ease!

💬 Comments ↗ Share ★ Save
AD