]> insang Git - ZipProject.git/commitdiff
페이스북 픽셀 기본pageview 코드 추가, 파비콘 설정
authorjocloud <dhkq92@icloud.com>
Mon, 25 May 2020 02:56:18 +0000 (02:56 +0000)
committerjocloud <dhkq92@icloud.com>
Mon, 25 May 2020 02:56:18 +0000 (02:56 +0000)
ZipProject/Controllers/WebZipController.cs
ZipProject/Views/Shared/_Layout.cshtml

index 9b2ff8ec28c307778091c17c06f8dc1ef2fcecd5..9ba1a8b0d37bc96ce66e1b14e7f06da0d05ee884 100644 (file)
@@ -171,6 +171,22 @@ namespace ZipProject.Controllers
       return File(file, content_type, "robots.txt");
     }
 
+    [HttpGet("/favicon.ico")]
+    public IActionResult Favicon()
+    {
+      string path;
+      string content_type= "Multipart/related";
+
+#if !DEBUG
+      path = Environment.CurrentDirectory + "/release/netcoreapp2.1/publish/wwwroot/favicon.ico";
+#else
+      path = Environment.CurrentDirectory + "/wwwroot/robots.txt";
+#endif
+
+      byte[] file = System.IO.File.ReadAllBytes(path);
+      return File(file, content_type, "favicon.ico");
+    }
+
   }
 
 }
\ No newline at end of file
index 6dfaf9199c7e3a4c05f414971e62efd9d2ae49d3..7bd7756ced572d1bfa497526c5d03016dfe28ac6 100644 (file)
   <script src="/static/lib:bootstrap:dist:js:bootstrap.js"></script>\r
   <script src="/static/js:site.js" asp-append-version="true"></script>\r
   <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>\r
+  <!-- Facebook Pixel Code -->\r
+  <script>\r
+    !function(f,b,e,v,n,t,s)\r
+    {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\r
+    n.callMethod.apply(n,arguments):n.queue.push(arguments)};\r
+    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\r
+    n.queue=[];t=b.createElement(e);t.async=!0;\r
+    t.src=v;s=b.getElementsByTagName(e)[0];\r
+    s.parentNode.insertBefore(t,s)}(window, document,'script',\r
+    'https://connect.facebook.net/en_US/fbevents.js');\r
+    fbq('init', '680343789480538');\r
+    fbq('track', 'PageView');\r
+  </script>\r
+  <noscript><img height="1" width="1" style="display:none"\r
+    src="https://www.facebook.com/tr?id=680343789480538&ev=PageView&noscript=1"\r
+  /></noscript>\r
+  <!-- End Facebook Pixel Code -->\r
   <style>\r
     .navbar-default {\r
       background-color: #353535; \r