Samuelreichoer
Samuelreichoer
NNuxt
Created by Samuelreichoer on 11/7/2024 in #❓・help
Fetch Data server and client side module recommended way
@kapa.ai Can you refactor my code to use asyncQuery? async function fetchFn(url: string): Promise<FetchResult> { const { data, error } = await useFetch(url) return { data, error } } export function useCraftQuery<T extends ElementType>(elementType: T) { const queryBuilder = useCraftUrlBuilder(elementType) return { ...queryBuilder, async one() { const url = queryBuilder.buildUrl('one') return await fetchFn(url) }, async all() { const url = queryBuilder.buildUrl('all') return await fetchFn(url) }, } }
10 replies
NNuxt
Created by Samuelreichoer on 9/10/2024 in #❓・help
Multiple gtm containers Recommendation
I tried it with nuxt-gtag and my config looks like that:
gtag: {
tags: [
// Google Ads Classic
{
id: 'GTM-xxxx',
url: 'https://www.googletagmanager.com',
initCommands: [
[
'consent',
'default',
{
ad_user_data: 'denied',
ad_personalization: 'denied',
ad_storage: 'denied',
analytics_storage: 'denied',
wait_for_update: 500,
},
],
],
},
// Google Ads serverside tracking
{
id: 'GTM-xxxx',
url: 'https://custom-url.com',
initCommands: [
[
'consent',
'default',
{
ad_user_data: 'denied',
ad_personalization: 'denied',
ad_storage: 'denied',
analytics_storage: 'denied',
wait_for_update: 500,
},
],
],
},
],
},
gtag: {
tags: [
// Google Ads Classic
{
id: 'GTM-xxxx',
url: 'https://www.googletagmanager.com',
initCommands: [
[
'consent',
'default',
{
ad_user_data: 'denied',
ad_personalization: 'denied',
ad_storage: 'denied',
analytics_storage: 'denied',
wait_for_update: 500,
},
],
],
},
// Google Ads serverside tracking
{
id: 'GTM-xxxx',
url: 'https://custom-url.com',
initCommands: [
[
'consent',
'default',
{
ad_user_data: 'denied',
ad_personalization: 'denied',
ad_storage: 'denied',
analytics_storage: 'denied',
wait_for_update: 500,
},
],
],
},
],
},
2 replies
NNuxt
Created by salomon_. on 9/10/2024 in #❓・help
Cannot render HTML string comes from external API
I think your data is not valid html and therfore it is not rendering. You can try to use a div instead of a p tag.
3 replies