Google Analytics script is missing
Hey goodday,
I am trying to add google analytics to my video in cloudinary and i keep getting missing script although i have added the script tag in the head of my nuxt project.
my app.html
<!DOCTYPE html>
<html lang="en" {{ HTML_ATTRS }}>
<head {{ HEAD_ATTRS }}>
{{ HEAD }}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-NL036HZPGP"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-NL036HZPGP');
</script>
</head>
<body {{ BODY_ATTRS }}>
{{ APP }}
</body>
</html>
my index.vue
<template>
<div>
<video
id= "video-player"
class="cld-video-player"
>
</video>
</div>
</template>
<script>
export default {
data(){
return{
cld: null,
player: null,
video: "production_ID_4456999_gr6iy4"
}
},
mounted(){
this.cld= cloudinary.Cloudinary.new({
cloud_name: 'amarachi-2812',
secure: true
})
this.player = this.cld.videoPlayer(
'video-player', {
controls: true,
analytics: true
}
);
this.player.source(this.video);
}
}
error
-
Hi Iheanacho Amarachi Sharon
We don’t have an example for Nuxt specifically, but the most likely reasons for a failure are either including the video player before the analytics code or using the player without including the Google Analytics code.
Did you trying following the code example in the following link:
https://cloudinary.github.io/cloudinary-video-player/analytics.html
It shows an example of how to use Google Analytics with the Video Player
Let me know if you need any further assistance
Regards
Adi0 -
Hey Adi,
I added the script tag in the head section of my code before adding the player, also when i tried to used the google analytics package i still get the error, the error only goes when i remove the
analytics: {
events: [
'play',
'pause',
'ended'
]
}feature but i need that feature to track events like play, pause, stop0 -
Hey Iheanacho Amarachi Sharon,
Can you please open a direct ticket via https://support.cloudinary.com/hc/en-us/requests/new and give us access to the page you test this on so that we can take a deeper look into the page code?
0
Post is closed for comments.
Comments
3 comments