How can I add Google Tag Manager and Google Analytics scripts in Vue.js with dynamic container id and tracking id? - vue.js

I have a multi-tenant Vue.js application. Google Tag Manager container id and Google Analytics tracking id is coming from the api for every tenant. Because of that I can't add the scripts inside of index.html.
So my question is how can I add them to index.html with dynamic id's?

Related

Dynamically add meta Tags based on route in Angular which should render in chat-bots

I'm using Angular 13 for my application which is hosted in S3 Bucket. Thus far, I have my routes set up, and the page title and meta tags changes dynamically based on the activated route using #angular/platform-browser in browser but when i try to share the link in any social media platform there chat-bot is basically fetching the default meta tags and URL link preview is been generated based on those meta tags
I am not able to get dynamic meta tags to show the preview of the link, when shared in chat-bots
I have tried researching on the web and found some library's which didn't work out and i have even tried out SSR(server side rendering) where i am facing an unknow build error.
I have even tried Hosting in EC2 and running server using docker and port mapping it to the domain.
I assume, Any library we use should be able to assign dynamic meta tags content as they run script in backend process where as chat-bot doesn't run java script so thats the reason then are unable to fetch dynamic meta tags
Can anyone please let me know , if there's a way to achieve the dynamic meta tags , without changing the stack from Angular

Planting an Iframe as Aura component to show an external system that receives information from Salesforce API using oAuth web server flow

I have built a web app for our sales team.
The web app is currently using oAuth web server flow in order to authenticate with Salesforce.
Everything is working fine when running it on a separate tab.
We recently wanted to add some functionality from within Salesforce specific objects and display information from our web app.
So I've built an aura component displaying an Iframe with the URL from our web app.
Unfortunately, it crashes with a console error
Refused to frame 'https://***.my.salesforce.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'".
So I went to Salesforce's login page and indeed, there is a policy header that prevents it from being loaded from within an Iframe.
What is the correct way to authenticate the user with Salesforce in this situation?
Thank you very much
If you are calling a web app inside of an Iframe(Aura component) it would require the Salesforce domain calling it to be whitelisted in the web app.

Add data attribute to google analytics tag added by google tag manager

I use google tag manager to add ga script to my page. I am using Cookie consent plugin https://github.com/orestbida/cookieconsent. To control scripts it is recommended to add data-cookiecategory="analytics" attribute to script link. Is this possible to do in google tag manager? There are no options to add any attribute. Thank you.

Deploying a Vue.JS application as a 'widget' into an existing website

We have built a little search and list results application using Vue CLI / and REST on the backend. It is working well and addresses a common need within our organization. It seems like we should be able to take the 'packaged'/deployed version of it and give instructions to other websites within our organization to include it on their website. Similar to how google maps and others have instructions to copy and paste a snippet of code into your web page. Any suggestions on how to go about that for a Vue.js 3 application?

How to check which errors I have in my Google API project?

I'd like to use this plugin with my Jekyll site to show page views for each post/ page. So I installed the plugin and set up a service account for Google data API. The site is generating but I get no data from Google Analytics for my page views (it shows 0). On the projects overview page in Google Developer Console I see that I'm getting errors. But I can't figure out how to check these errors?
Is there any way to see what these errors are?
How can I check if Google API is working at all on my site?
The problem was with permissions when you add a new user to Google Analytics account. I had only Read & Analyze, and it should be all four (Manage Users, Edit, etc.).