MF Google Analytics

Developer

Matthieu Fauveau

3rd Party (Free)


EE Version Support

  • ExpressionEngine 2

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Webservice
  • Publisher

Requirements

  • jQuery for the Control Panel

Add-On Type(s)

Plugin

Tags

This plugin adds the Google Analytics tracking code in templates.

Changelog
      ********************************************************************
     
      Version 0.1
     
      This is inspired by my work converting Nicolas Bottari’s plugin.
      This version correct a few bugs and support only asynchronous tracking.     

      Tracking Code
      ********************************************************************

    —————————
      EXAMPLE USAGE:
    —————————

      {exp:mf_google_analytics account="UA-XXXXXXX-X"}

    —————————
      PARAMETERS:
    —————————

      account="UA-XXXXXXX-X"
      - The Google Analytics ID for your site. This is required.
     
      one_push="y"
      - Instead of having _gaq.push(...) for each call, all of your commands can be pushed at once. By default, this value is set to "y". Set it to "n" to disable this behavior.

      allow_hash="y"
      - Sets the allow domain hash flag. By default, this value is set to "y". Set it to "n" to disable this behavior.
      The domain hashing functionality in Google Analytics creates a hash value from your domain, and uses this number to check cookie integrity for visitors.
      If you have multiple sub-domains, such as example1.example.com and example2.example.com, and you want to track user behavior across both of these sub-domains,
      you would turn off domain hashing so that the cookie integrity check will not reject a user cookie coming from one domain to another.
      Additionally, you can turn this feature off to optimize per-page tracking performance.
     
      allow_linker="n"
      - Sets the linker functionality flag as part of enabling cross-domain user tracking. By default, this method is set to "n" and linking is disabled.
      Set it to "y" to enable it. This should only be used if you track across multiple domains and sub-domains. When used, you should use the link and linkbypost methods.
     
      cookie_path="/myBlogDirectory/"
      - Sets the new cookie path for your site. By default this is not used, Google Analytics automatically set this to "/".
     
      domain_name=".mysite.com"
      - Sets the domain name for cookies. There are three modes to this method : "auto", "none", "[[]domain]". By default, the method is set to "auto", which attempts to resolve the domain name based on the location object in the DOM.

      site_search="y"
      - Enable the Site Search functionnality of Google Analytics. By default, this value is set to "n".
      If set to "y", the plugin will track Site Search queries on search result pages (i.e. search result pages where the last segment is the EE search id).
     
      site_search_query_parameter="/search/results?q="
      - Sets the Site Search Query Parameter set in Google Analytics for the Site Search functionnality.
      If site_search is set to "y" the default value is "/{segment_1}?q=".

      split="n"
      - Enable splitting of the code of the tracking code
      If you prefer to put the Analytics snippet at the bottom of the page, you should know that you don’t have to put the whole snippet at the bottom.
      You can still keep most of the benefits of asynchronous loading by splitting the snippet in half—keep the first half at the top of the page and
      move the rest to the bottom.
      Because the first part of the tracking snippet has little to no afect on page rendering, you can leave that part at the top and put the part of
      the snippet that inserts ga.js at the bottom.
      By default, the method is set to "n". If you set it you need to output the ga.js part by using {exp:mf_google_analytics:ga_js} just before the </body> tag.

 

      Track page view function
      ********************************************************************
     
      This function act as an helper to push trackPageview. You can use it to track mailto links or file download.
     
    —————————
      EXAMPLE USAGE:
    —————————

      <a href="http://example.com/test.html" onclick="{exp:mf_google_analytics:track_page_view target_url=’/downloads/file.zip’}">click me</a>
         
    —————————
      PARAMETERS:
    —————————
     
      target_url="/downloads/file.zip"
      - The mailto/file/outbound link to track.

 

      Link function
      ********************************************************************
     
      This function works in conjunction with the domain_name and allow_linker methods to enable cross-domain user tracking.
      It will passes the cookies from this site to another via URL parameters (HTTP GET). It also changes the document.location and redirects the user to the new URL.
      allow_linker must be set to "y" in tracking code for this to work properly.
     
    —————————
      EXAMPLE USAGE:
    —————————

      <a href="http://example.com/test.html" onclick="{exp:mf_google_analytics:link target_url=‘http://example.com/test.html’}">click me</a>
         
    —————————
      PARAMETERS:
    —————————
     
      target_url="http://example.com/test.html"
     
      use_hash="y"
      - Set to "y" for passing tracking code variables by using the # anchortag separator rather than the default ? query string separator. By default, the method is set to "n".
     
     
     
      Link by post function
      ********************************************************************
     
      This function works in conjunction with the domain_name and allow_linker methods to enable cross-domain user tracking.
      It will passes the cookies from the referring form to another site in a string appended to the action value of the form (HTTP POST). This method is typically used when
      tracking user behavior from one site to a 3rd-party shopping cart site, but can also be used to send cookie data to other domains in pop-ups or in iFrames. 
      allow_linker must be set to "y" in tracking code for this to work properly. 
     
    —————————
      EXAMPLE USAGE:
    —————————

      <form action="http://www.shoppingcartsite.com/myService/formProcessor.php" name="f" method="post" onsubmit="{exp:mf_google_analytics:link_by_post}">
      ...
      </form>
       
    —————————
      PARAMETERS:
    —————————
     
      use_hash="y"
      -Set to "y" for passing tracking code variables by using the # anchortag separator rather than the default ? query string separator. By default, the method is set to "n".

MF Google Analytics Links

This entry was created March 21, 2011, 12:09 pm.
This entry was last updated March 21, 2011, 5:10 am.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

There are no reviews for this add-on yet.

What are you waiting for? Rate it and review it!