Separate analytics data for website and embed.

This commit is contained in:
kovacsv 2024-05-05 07:52:52 +02:00
parent 6311e69163
commit fd00872b95
3 changed files with 12 additions and 8 deletions

View File

@ -67,10 +67,14 @@ def CreateWebsite (rootDir, websiteDir, version, testBuild):
if os.path.exists (metaFile): if os.path.exists (metaFile):
metaContent = Utils.GetFileContent (metaFile) metaContent = Utils.GetFileContent (metaFile)
replacer.ReplaceTokenContent ('<!-- meta start -->', '<!-- meta end -->', metaContent) replacer.ReplaceTokenContent ('<!-- meta start -->', '<!-- meta end -->', metaContent)
analyticsFile = os.path.join (rootDir, 'plugins', 'website_analytics_data.txt') websiteAnalyticsFile = os.path.join (rootDir, 'plugins', 'website_analytics_data.txt')
if os.path.exists (analyticsFile) and not testBuild: if os.path.exists (websiteAnalyticsFile) and not testBuild:
analyticsContent = Utils.GetFileContent (analyticsFile) websiteAnalyticsContent = Utils.GetFileContent (websiteAnalyticsFile)
replacer.ReplaceTokenContent ('<!-- analytics start -->', '<!-- analytics end -->', analyticsContent) replacer.ReplaceTokenContent ('<!-- website analytics start -->', '<!-- website analytics end -->', websiteAnalyticsContent)
embedAnalyticsFile = os.path.join (rootDir, 'plugins', 'embed_analytics_data.txt')
if os.path.exists (websiteAnalyticsFile) and not testBuild:
embedAnalyticsContent = Utils.GetFileContent (embedAnalyticsFile)
replacer.ReplaceTokenContent ('<!-- embed analytics start -->', '<!-- embed analytics end -->', embedAnalyticsContent)
replacer.WriteToFile (htmlFilePath) replacer.WriteToFile (htmlFilePath)
def CreateEnginePackage (rootDir, engineDir, websiteDir): def CreateEnginePackage (rootDir, engineDir, websiteDir):

View File

@ -16,7 +16,7 @@
<script type="text/javascript" src="../build/website_dev/o3dv.website.min.js"></script> <script type="text/javascript" src="../build/website_dev/o3dv.website.min.js"></script>
<!-- website end --> <!-- website end -->
<!-- analytics start --> <!-- embed analytics start -->
<script type="text/javascript"> <script type="text/javascript">
OV.SetWebsiteEventHandler ((eventName, eventLabel, eventParams) => { OV.SetWebsiteEventHandler ((eventName, eventLabel, eventParams) => {
console.log ({ console.log ({
@ -26,7 +26,7 @@
}); });
}); });
</script> </script>
<!-- analytics end --> <!-- embed analytics end -->
<!-- embed init start --> <!-- embed init start -->
<script type="text/javascript"> <script type="text/javascript">

View File

@ -19,7 +19,7 @@
<!-- plugins start --> <!-- plugins start -->
<!-- plugins end --> <!-- plugins end -->
<!-- analytics start --> <!-- website analytics start -->
<script type="text/javascript"> <script type="text/javascript">
OV.SetWebsiteEventHandler ((eventName, eventLabel, eventParams) => { OV.SetWebsiteEventHandler ((eventName, eventLabel, eventParams) => {
console.log ({ console.log ({
@ -29,7 +29,7 @@
}); });
}); });
</script> </script>
<!-- analytics end --> <!-- website analytics end -->
<!-- website init start --> <!-- website init start -->
<script type="text/javascript"> <script type="text/javascript">