Map array in server side Google tag manager

Sometimes you need to send to a third party service a different array structure than the one specified on Google Analytics 4 (GA4). So, in case you don’t want to create a new event only for this service and you want to reuse as much as posible a GA4 event like add_to_cart, then you need to map the GA4 built in array on GTM. This sounds pretty easy if you have used GTM (no server side) before, basically you create a new custom javascript variable and return the mapped array. However, on GTM using a server side container, the custom javascript variable is no longer available. ...

May 8, 2024 · 2 min · Elvin Guti

Show full branch name on powerlevel10k theme

powerlevel10k is a popular zsh theme and my favorite one. However, branch names are truncated if these are pretty long. Although, you can remove this limitation by updating its config file: vim ~/.p10k.zsh Search for the branch name and comment the line that’s doing the truncation: # Tip: To always show local branch name in full without truncation, delete the next line. # (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line You might need to restart zsh ...

April 16, 2024 · 1 min · Elvin Guti

Untrack/Remove git files

If you accidentally committed files on git because you didn’t have a .gitignore file or you just updated it, you can untrack files with: git rm --cached <file> or if you have several files: git rm --cached `git ls-files -i -c --exclude-from=.gitignore`

April 15, 2024 · 1 min · Elvin Guti

How to setup multiple ssh keys for different github repos

Create key and add it to github Create ssh key: ssh-keygen -t ed25519 -C "your_email@example.com" Add your key to agent: ssh-add ~/.ssh/elvinguti_key Add key to github. Update config Update ~/.ssh/config: Host github.com HostName github.com IdentityFile ~/.ssh/my_work_key IdentitiesOnly yes Host elvinguti.github.com HostName github.com User elvinguti IdentityFile ~/.ssh/elvinguti_key IdentitiesOnly yes you might need to restart the ssh-agent: eval $(ssh-agent -s) Then you should be able to clone a repo or update the git remote url: # URL Format: git@host_alias:user/repo_name.git # Existing repo git remote set-url origin git@elvinguti.github.com:elvinguti/elvingutidev.git` # Clone repo git clone origin git@elvinguti.github.com:elvinguti/elvingutidev.git

April 12, 2024 · 1 min · Elvin Guti