Skip to content

Simple all In one Google Ads/Analytics, Yandex Direct/Mertrika, Facebook Ads Pixel tracker

License

Notifications You must be signed in to change notification settings

pdevyatov/Analytics-Conversion-Tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Analytics-Conversion-Tracking

Simple all In One Google Ads/Analytics, Yandex Direct/Mertrika, Facebook Ads Pixel tracker

How to use

  1. Put the "conversionTracker.js" in yor site folder.

  2. Add some class to any buttons, links, or items on the page. For example:

    <button class="firstButton">
      First Button
    </button>

    <button class="secondButton">
      Second Button
    </button>
  1. For all classes that you added, you need to call function ConversionTracker() each time. The first parameter of the function is the button class, the second parameter is the name of the conversion.

  2. Add this code before </body> tag

    <script src="./conversionTracker.js"></script>
    <script>
      conversionTracker('firstButton', 'nameOfConversion')
      conversionTracker('secondButton', 'nameOfConversion2')
    </script>
  1. In 'conversionTracker.js' delete any network thay you do not need. If you use Yandex, than you need to insert your account code into it.

  2. Last step is to add conversions in analytics:

Google Analytics: Administrator => Goals => New Goal => Own => Type any title and choose Event => Type in "Category" & in "Action" name of your conversion. Example: nameOfConversion

Yandex Metrica: Settings => Goals => Add Goal => JavaScript Event => In "Goal ID" type name of your conversion

About

Simple all In one Google Ads/Analytics, Yandex Direct/Mertrika, Facebook Ads Pixel tracker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published