Skip to content

Enable banner via Google Tag Manager#696

Merged
dgarcia360 merged 4 commits intoscylladb:masterfrom
dgarcia360:enable-banner-tag-manager
Feb 28, 2023
Merged

Enable banner via Google Tag Manager#696
dgarcia360 merged 4 commits intoscylladb:masterfrom
dgarcia360:enable-banner-tag-manager

Conversation

@dgarcia360
Copy link
Copy Markdown
Collaborator

@dgarcia360 dgarcia360 commented Feb 14, 2023

Adds the option to enable the banner via Google Tag Manager.

How to test this pull request

To enable the banner, follow these steps to configure the tag via Google Tag Manager:

  1. Log in to Google Tag Manager at https://tagmanager.google.com/.

  2. Open the account assigned to this project: GTM-T8P2JP.

  3. Select Tags from the left sidebar.

    image

  4. Click New and configure the tag with the following settings:

    image

    • Type: Custom HTML

    • Body:

      <meta name="scylladb-docs-hide_banner" content="false" />
      <meta name="scylladb-docs-banner_title_text" content="Title text" />
      <meta name="scylladb-docs-banner_button_text" content="Button text" />
      <meta name="scylladb-docs-banner_button_url" content="https://docs.scylladb.com" />
      
    • Trigger: On initialization on all pages.

  5. Click Save.

  6. Click Submit and fill in the information to release a new version of the tag.

    image

  7. Click Publish.

  8. Clone this pull request, navigate to the docs folder, and run make preview. Open http://127.0.0.1:5500/ in incognito mode to ensure that your browser does not keep any cookies from previous browsing sessions.

You should now see the announcement banner on the website 🎉

IMPORTANT: Once you've done the test, remember to delete the tag so that a banner with a sample text appears on all sites once we release a new version of the theme.

Editing the banner content

You can customize the banner's title, button text, and URL by editing the content attribute of the corresponding meta key. For example:

<meta name="scylladb-docs-hide_banner" content="false" />
<meta name="scylladb-docs-banner_title_text" content="Title text" />
<meta name="scylladb-docs-banner_button_text" content="Button text" />
<meta name="scylladb-docs-banner_button_url" content="https://docs.scylladb.com" />

To change a property, edit the tag's body accordingly. Once you've made the changes, remember to publish a new version of the tag.

Disabling the banner

To disable the banner, you have two options:

a. Delete the tag on Google Tag Manager.

b. Set the meta attribute scylladb-docs-hide_banner to true.

   <meta name="scylladb-docs-hide_banner" content="false" />

In both cases, remember to publish a new version.

@dgarcia360 dgarcia360 marked this pull request as draft February 14, 2023 17:40
@dgarcia360 dgarcia360 marked this pull request as ready for review February 24, 2023 11:45
@dgarcia360 dgarcia360 added the enhancement New feature or request label Feb 24, 2023
@tzach
Copy link
Copy Markdown
Collaborator

tzach commented Feb 28, 2023

LGTM

@annastuchlik
Copy link
Copy Markdown
Collaborator

@dgarcia360 I have no permissions to review this PR, but it has been reviewed by Tzach.

@dgarcia360 dgarcia360 merged commit 86fb6ee into scylladb:master Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants