Category: Engineering

  • Using Github to display Github Pages

    Using Github to display Github Pages

    GitHub Pages is a free and user-friendly way to host websites directly from your GitHub repository. Whether you’re showcasing a portfolio, documentation, or a blog, GitHub Pages makes it simple to publish your project.


    What is GitHub Pages?

    GitHub Pages is a static site hosting service integrated with GitHub. It takes files from a branch in your repository, runs them through a build process (if needed), and publishes them as a website. You can use this with your own purchased domain name or utilize the github.io URL that they provide you.


    Setting Up GitHub Pages

    1. Create or Select a Repository:
      • Log in to your GitHub account and create a new repository or use an existing one.
      • Ensure your files are ready for the web (e.g., HTML, CSS, JS).
    2. Enable GitHub Pages:
      • Go to the repository’s Settings.
      • Navigate to the Pages section.
      • Select the branch to use for your site (e.g., main or gh-pages). Optionally, set a folder like /root or /docs for source files.
      • Click Save.
    3. Access Your Site:
      • After a few moments, your site will be live at:
        https://<username>.github.io/<repository-name>/

    Adding Content

    • Simple Static Files: Place index.html in the root of your repository for a basic static site.
    • Jekyll Support: Use Jekyll, a static site generator, to add blogs or themes. GitHub Pages automatically processes Jekyll sites.
      • Add a _config.yml file for customization.
    • Markdown Support: Write .md files, and Jekyll will render them as HTML.

    Advanced Features

    1. Custom Domains:
      • Set up a custom domain by adding your domain in the Pages settings.
      • Add a CNAME file to your repository with your domain name.
    2. SSL Certificates:
      GitHub Pages automatically provides HTTPS for secure browsing.
    3. GitHub Actions for Automation:
      Automate builds or deploy processes with custom GitHub Actions workflows.

    Common Issues and Debugging

    1. 404 Errors:
      • Check if index.html exists in the root directory.
      • Verify the correct branch and folder in the Pages settings.
    2. Jekyll Build Errors:
      • Review error logs provided in the GitHub Pages build section.
      • Disable Jekyll processing by adding an empty .nojekyll file.
    3. Delayed Updates:
      • Changes may take a few minutes to propagate. Clear your browser cache if updates aren’t visible. Evaluate after waiting a couple minutes if you’re not immediately seeing changes.
    4. Custom Domain Errors:
      • Ensure DNS records are properly configured (e.g., A records for GitHub’s IPs or a CNAME pointing to username.github.io).

    Why Use GitHub Pages?

    • Free Hosting: Perfect for personal projects or small websites.
    • Easy Deployment: Push changes to your repository, and GitHub takes care of the rest.
    • Community Support: Leverage GitHub’s massive community for advice and resources.

    GitHub Pages is a fantastic tool for hosting static websites effortlessly. With just a repository and a few configuration steps, you can create and deploy a professional-looking site in minutes.

  • Debugging Google Ads with Google Publisher Console

    Debugging Google Ads with Google Publisher Console

    Google Ads provides several debugging tools, and one of the incredibly effective techniques is simply appending the google_console=1 query parameter to your URL. This enables detailed logs in your browser console, making it easier to diagnose and fix issues with ad scripts, tracking tags, or conversions.

    What is google_console=1?

    Adding google_console=1 to your URL activates verbose logging for Google Ads scripts. It’s particularly useful for debugging issues like:

    • Misfiring conversion tags.
    • Incorrect or missing parameter values.
    • Validation errors in dynamic remarketing tags.

    How to Use It

    1. Enable the Debug Mode:
      Simply append ?google_console=1 to your URL. If there are already query parameters in the URL, append &google_console=1.
      • Example:
        https://example.com/landing-page?google_console=1
    2. Open Your Browser Console:
      Access the console in your browser’s Developer Tools (e.g., Ctrl + Shift + J in Chrome). You’ll see logs generated by Google Ads scripts, including errors, warnings, and informational messages.

    What to Look For

    Once activated, the console will provide detailed logs for all Google Ads activity on the page. Here are some key things to watch:

    1. Tag Firing Events:
      Look for messages like:
      Google Ads: Conversion tag fired
      This confirms the tag is working as expected.
    2. Parameter Validation:
      Logs will indicate whether required parameters (e.g., conversion_value, transaction_id) are being passed. Missing or incorrect values will trigger warnings.
    3. Remarketing Tag Debugging:
      If you’re using dynamic remarketing, the console will validate attributes and provide feedback if any are missing or improperly formatted.
    4. Errors or Warnings:
      Pay attention to:
      • “No HTTP response detected”: Indicates a tag isn’t firing correctly.
      • “Parameter mismatch”: Suggests issues with dynamic values.

    Key Benefits of google_console=1

    • Detailed Feedback: Get precise messages about what’s working and what’s not.
    • Real-Time Validation: Understand tag and parameter behavior instantly.
    • Simplified Debugging: Eliminate the guesswork for dynamic or custom scripts.

    The google_console=1 query parameter is an underutilized but powerful tool for debugging Google Ads setups. By enabling verbose logs, you can quickly identify and resolve issues, ensuring your campaigns track and perform as expected.

    Read More from the official developers.google.com:
    https://developers.google.com/publisher-tag/guides/publisher-console