insert google analytics code in javascript file -


Maybe duplicate:

I tried to add Google's data code for JS file And I do not think so.

I tried 3 ways

1

  document.getElementsByTagName ('body') [0] .innerHTML + = "(L, ii) .q = i [r] .q || []). Push (logic) }, I [r] .l = 1 * new date (); a = s.create element (o), i = s.getElementsByTagName (o) [0]; a.async = 1; a.src = g; M.parentNode.insertBefore (A, M)}) (window, document, 'script', '//www.google-analytics.com Ga (' send ',' pageview '); & lt; / script & gt; Enter the code to the 2 function and call the function "window.onload" on "phone call"  
  function googleAna ({{function (i, s, o, g, r, a, m) {i ['GoogleAnalyticsObject'] = R; ii [r] = i [R] | function () {(i [r]. C = i [r]. K || []). Push (s) C)}, i [r] .l = 1 * new date (); a = s.createElement (o), m = s.getElementsByTagName (o) [0]; a.async = 1; a.src = g ; M.parentNode InsertBefore (a, m)}) (window, document, 'script', '// www.google-analytics.com/analytics.js','ga'); GA ('create', 'UA -48139516-1 ',' accessbar.co.il '); Ga ('Send', 'Pageview'); }   
  1. Enter the code as a JS file and load it while reading the JS file

    all in In cases, Google did not recognize that I put the code.

    Yes, you can put the code in another javascript file. When you add a javascript file to the page, then you will be as if you had added it to the main file.

    How do you know that it was not working? Have you examined real-time reports that should be shown exactly.


      & lt; Script & gt; (The function (i, s, o, g, r, a, m) can take up to 24 hours before standard data can be viewed. {I ['GoogleAnalyticsObject'] = R; I [R] = I [R] | | Function () {(I [R] .K = I [R] .Q [[]). Push (Logic)}, I [R]. L = 1 * New Date (); A = S. Sequet Element (O), M = S. ElementElementBitagname (O) [0]; AASINCC = 1; ASRC = G; M.ParentNode.insertBefore (a, m)}) (window, document, 'script', '// Www.google-analytics.com/analytics.js', 'ga'); GA ('Create', 'UA-48139516-1', 'accessbar.co.il'); Ga ('Send', 'Pageview'); & Lt; / Script & gt;   

    If you copy the same and keep it in the section of your website, it should start logging. I think maybe in your version NR 2 for you.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -