Submitting a goal to Google Analytics. Submitting a goal to Google Analytics Where to find the google analytics tracking ID

This may be a simple question, but right now I am full of doubts about adding Google Analytics Tracking ID on GitHub page.

I am using the automatic GitHub page generator to build my GitHub page, but it asks for a "Google Analytics Tracking ID". I tried to sign up with Google Analytics, but there it asks for the site url.

What should I do now?

Another question: can we add the Google Analytics Tracking ID later, after creating the GitHub page?

8 answers

Update: added step descriptions for others

Solved this:
had to include username.github.io (the link I want to track) in the Google Analytics section of the site.

You can check out the GitHub help page

After that, I was provided with a tracker ID.

Note. You can easily change or add additional websites on the Google Analytics page from the Google Analytics admin panel.

Update 2: - Adding Google Analytics Tracking ID to Already Created Github Pages(on request @ avi-aryan)

For anyone wondering if you are using Jekyll with GitHub Pages, I just wrote a post on how to properly add Google Analytics Tracking ID to Jekyll.

    You can find the Universal Analytics tracking code under Admin> Property> Tracking Info> Tracking Code.

    Create a new file called analytics.html in the _includes folder found in your Jekyll websites directory.

    Add your Google Analytics tracking ID to analytics.html.

    Finally, open _layouts / head.html and add (% include analytics.html%) just before the tag... Google recommends this placement to properly track all of the pages on your site.

    If you are using the minimum pattern provided by Jekyll then -

    1. Add google_analytics: UA-xxxxxxxx-x to your _config.yml
    2. Create a file _includes / google-analytics.html and add the Google Analytics js code to it.

    replace

    Ga ("create", "UA-xxxxxxxx-x", "auto");

    Ga ("create", "((site.google_analytics))", "auto");

    and you are tuned!

    You can follow the same approach if using a different template by referencing the template source and replacing the appropriate files.

    You can add Google Analytics to a Jekyll site just like any other site.

    First, after setting up your Google Analytics account, go to the admin tab.

    Then, under the accounts panel on the left, click: Create New Account.

    In Google Analytics, an account is a collection of pages that you want to track. Set up your website account as you see fit.

    Once your account has been created, you will be taken to a page that will tell you your Tracking ID, and you have a JavaScript snippet to place on the pages you want to track. Just post this snippet on all the pages you want to track. Or, if you are using the default layout, place this snippet somewhere in it.

    By the way, since you are hosting on GitHub pages, you don't need Google Analytics unless you want very granular analytics. If all you want are the pageviews that GitHub has.

    If you are using the auto-generated github page from your github README.md I found it the easiest way: just edit your _config.yml so that it looks like this (with your own google Analytics UA UA id):

    Theme: jekyll-theme-cayman title: My Site description: My site description url: https://example.com author: MyName plugins: - jekyll-seo-tag google_analytics: UA-xxx

    Then add a new file to the root of your repository named Gemfile with this content:

    Source "https://rubygems.org" gem "github-pages", group:: jekyll_plugins gem "jekyll-seo-tag"

    Fortunately, from the installation instructions, I didn't need to add (% seo%) to the html, because I don't have the html. Github seems to have thought about this.

    Greetings, friends! Our today's material is devoted to web analytics and such an issue as getting the client id of Google Analytics. Usually this question comes up when integration with various additional services is required, such as CRM systems, tracking mailing lists and offline activities.

    We have prepared 4 real ways to do this, illustrated them, so you just have to read, choose one of the ways to get the Google Analytics client id and do everything according to the instructions.

    What is the client id (CID)?

    For a better understanding of the issue, it will not be superfluous to explain what a client id is. In essence, this is a unique user (not a specific person, but for example a smartphone-browser bundle), whose function is to store information about visiting a site. And at the moment when we need to send offline data to Google Analytics and associate it with a visit to our resource, we need to specify this key.

    How it works? Let's say you have a landing page and an ad set up. Applications are received daily from the site, processed and then entered into CRM. After some time, some of them receive payment and in order to transfer data about the payment to Google Analytics and understand which ad or search phrase brought us income and in what amount, we need a client id

    4 ways to get client id of Google Analytics

    1 way. Install on the Universal Analytics website (aka Google Analytics).

    After that, calling the following code, the javascript variable clientId will contain the value we need:

    ga (function (tracker) (var clientId = tracker.get (‘clientId’);));

    Method 2. With PHP by making a request to the server.

    // Handle the parsing of the _ga cookie or setting it to a unique identifier
    function gaParseCookie () (if (isset ($ _ COOKIE ['_ ga'])) (list ($ version, $ domainDepth, $ cid1, $ cid2) = split ('[\.]', $ _COOKIE ["_ ga"] , 4); $ contents = array ('version' => $ version, 'domainDepth' => $ domainDepth, 'cid' => $ cid1. '.'. $ Cid2); $ cid = $ contents ['cid' ];) else $ cid = gaGenUUID (); return $ cid;
    }

    Method 3. We get the cid using JavaScript using the following code:

    function ()
    (var match = document.cookie.match (‘(?: ^ |;) \\ s * _ga = ([^;] *)’); var raw = (match)? decodeURIComponent (match): null;
    if (raw)
    {
    match = raw.match (/ (\ d + \. \ d +) $ /);
    }
    var gacid = (match)? match: null;
    if (gacid)
    (return gacid;
    }
    }

    Method 4. Google Tag Manager.
    When using this service, you will need to create a new variable - ga cookie:

    Secondly, we create a variable of type Custom HTML - cid and write to it:

    function () (try (var cookie = ((ga cookie)). split ("."); return cookie + "." + cookie;) catch (e) (console.log ("No Universal Analytics cookie found") ; return "n / a";)
    }

    Advertising on the Internet is becoming more expensive every year, therefore, it requires more and more accurate analysis, including accounting for offline conversions. We have already written about how to track. Be sure to use the knowledge gained and pump your internet marketing.

    If you have a Google Analytics account, then this guide is for you.

    To track incoming calls, you have the ability to easily and quickly create a goal with the "Event", Within which Roistat will send events to your GA account about incoming calls to the numbers specified in the section"Call tracking».

    Target is configured in Roistat and GA in just a few steps... The rest of the steps, such as adding JavaScript to your site's HTML or configuring communication parameters using the Measurement Protocol, have already been done for you by the Roistat command.

    Within one scenario, you can set up sending a goal to one Google Analytics counter.

    Targets are sent using dynamic and static call tracking scenarios. However, in the case of a static scenario, the goal in GA will not be tied to a specific source, since there is no Roistat visit number and Google ClientID.

    Principle of operation

    After the end of the incoming call, the HTTP request POST that passes parameters to the target.


    Target parameters that are passed in the request:

    Component Parameter in request Meaning User customization required
    protocol version v 1 No
    Google Analytics tracking code (resource) ID tid

    UA-XXXXXX-Y

    where XXXXXX- your account number, Y- number of the corresponding resource
    Yes
    anonymous client identifier (Client-ID) cid in the example: 12xx916x95.13x6127xx4 No
    hit typet event No
    event category ec phone No
    event action ea call No
    event label el roistat No

    Creation and customization

    Step 1. Setting up in Roistat

    To set up automatic sending of a target on a call in the Roistat system, it is enough to indicateonly the id of your Google Analytics propertywhere the targets should go. You don't need to make any additional settings in the code.

    1. To find out the resource ID, go to your GA account in the section “Administrator ". Select the desired resource and go to the page "Tracking code ". The resource identifier is displayed on the line “Tracking ID »:


    Copy it.

    2. In the Roistat profile in the desired project open script settings and go toStep 5 "Configure integrations" :


    3. In the block " Submitting a goal to Google Analytics " in field " »Enter the previously copied identifier:


    The settings will be saved after pressing the "Include script " or " Save not including ».

    Step 2. Setting up in GA

    1. In your GA account, you need to create a goal like “Event».

    For more information on how to create goals, read GA documentation.

    2. For the created target, specify the same parameters that are displayed in Roistat, namely:

      Action: call;

      Label: roistat.

    Set the rest of the parameters at your discretion.


    Setting up automatic sending of targets by call to GA is complete!

    Cancel sending a target

    To cancel sending, just clear the field “Resource ID (UA-XXX-Y) » in target settings in Roistat.

    View call goals in your GA account

    Events on the facts of calls (as well as detailed information about calls) can be viewed in GA in the subsection “Reports » → « Behavior » → « Developments »:


    • No labels

    We had one email marketing platform, a bunch of subscribers and the need to set up end-to-end analytics in emails and on the site linked to a user profile. And that's how it ended.

    It's about such a little-known feature of Google Analytics as the Measurment Protocol for email tracking. We'll take a look at how to properly set up a tracking pixel to track email openings in the GA interface, the number of subscribers who have interacted with you, and ‑ to analyze the email opening environment (mobile or web clients).

    This article is an adapted translation of material from the FreshInbox blog.


    Tracking pixel structure

    The first thing to do is set up your Google Analytics account: you need a working tracking ID (usually UA-XXXXXXX). If you don't have any of this yet, then you can read the instructions and quickly set everything up ☺

    Then you will need to set up a tracking pixel in order to then add it to the code of sent emails - it is with its help that you can transfer data from emails to your analytics account. The standard pixel structure based on the guidelines for creating it is as follows:

    Http://www.google-analytics.com/collect?v=1&tid=UAXXXXXX&t=event&cid=123123123&ec=kinetic&ea=interact&el=unit1&cn=campaign_20160130&cs=email

    • tid - tracking ID (ie. UA-XXXX) - and you need to use the same identifier that is set on your website in order to collect data in the account you need.
    • cid - subscriber identifier, in fact it is a session id or recipient id. This value must be unique for each subscriber in your database. You can use this email hash or subscriber ID in your mailing platform. The only thing is that it is strictly forbidden to transfer the actual email itself here, since Google prohibits the use of data for tracking that allows them to identify the user.
    • t - the type of the tracked action, should be set to event (type) to track events, not page views.
    • ec - the event category. This parameter is used to group events, here you can pass parameters such as email or kinetic, as we will use later in the examples.
    • ea - the type of event (event action), used for a more detailed grouping of the types of events performed by the user inside the letter, for example, for simply opening, tracking different email clients or watching an animation.
    • el - an additional parameter of the event (event label), serves for even deeper analytics, for example, here you can transfer the type of opening device (web, mobile or email client).
    • cn - the name of the campaign (campaign name), just like the campaign source, serves to identify a specific campaign in the email marketing channel.
    • cs - campaign source, required for campaign tracking.

    Plus, of course, you can add your own variables by analogy with UTM-tags and track the events or parameters you need. If you already have a well-established structure for UTM markup, then it makes sense to consider it here.

    Injecting a pixel into a newsletter

    Once you've configured all the pixel settings, it's time to add it to your email campaigns. We will be testing several parameters for a dynamic email with an image carousel and a hover - changing the image when the mouse pointer is hovering over it.

    Tracking opening

    The simplest is to track the usual opening of a letter, for this you should add the following code to the mailing list (it will work if the display of pictures in the letter is enabled):

    Hover code:

    .img-swap: hover .tpixel (background-image: url (http://www.google-analytics.com/collect?v=1&tid=UA-XXXXXX&t=event&cid=*|UNIQID|*&cn=test_campaign&cs=email&ec= kinetic & ea = interact & el = rollover);)

    True, this will not work everywhere. You will be able to track guidance mainly only in Mac Mail, Mozilla Thunderbird and some other mail clients. Most web interfaces will not be able to track guidance.

    The code for the carousel of images, implemented via radio-button. Note that for a carousel of three images, we set tracking only for the second and third - after all, the first is loaded by default.

    Radio2: checked ~ .carousel .tpixel (background-image: url (http://www.google-analytics.com/collect?v=1&tid=UA-XXXXXX&t=event&cid=*|UNIQID|*&cn=test_campaign&cs=email&ec= kinetic & ea = interact & el = radio2_select);) .radio3: checked + .carousel .tpixel (background-image: url (http: //www.google-analytics.com/collect? v = 1 & tid = UA-XXXXXX & t = event & cid = * | UNIQID | * & cn = test_campaign & cs = email & ec = kinetic & ea = interact & el = radio3_select);)

    Here, as in the previous version, it will be possible to track only in some mail clients, as well as this carousel will not work correctly everywhere.

    Tracking mobile discoveries:

    Tracking openings from mobile devices will also occur not in all mobile email clients, but only in standard ones: Mail (iOS) and mail on Android (up to version 5.0).

    Pixel testing

    Google Analytics is great because it allows you to get real-time statistics with minimal latency, so you can send yourself a test message or simply load the HTML feed in your browser and check if a pixel is being triggered.


    You can get to such a report in the menu Real-Time -> Events, also there you can see, for example, the number of events in the last 30 minutes.

    It should be noted that the event is tracked only once upon opening; to re-appear in the analytics, you need to reload the page with the open letter - this mostly concerns the hover, the statistics for which will work only once.

    Reports

    And now the fun begins - viewing analytics for your mailings. The reports can be found in the analytics interface under Behavior - Events - Top Events ( Behavior -> Events -> Top Events).

    Once on this screen, you get statistics grouped by the event category (ec) parameter. After clicking on the category you need (kinetic in our case), you get the following report with all actions displayed:


    In the screenshot you can see two indicators: Total Events and Unique Events, while the Total Events parameter is, in fact, the total number of tracking pixel downloads.

    But note that Unique Events is not the number of users who viewed the letter, but the number of sessions (sessions) during which the event was triggered. For more information on how the session is determined, you can

    At the same time, counting the number of unique users who opened the letter or interacted with it in any way is also available. To do this, you need to go to the report settings mode and add a new indicator "Users" there, the video below shows how this is done:

    Using the Google Analytics Pixel, you can work with email statistics data without the need to use an ESP interface, and you can also track the performance of emails sent using your local mail server or services like Amazon SES and Sendgrid.

    If you want to launch a successful website, it is important to know your audience and what they expect from your website. The best option to achieve this goal is to analyze your traffic. This is exactly what Google Analytics does. This is a free app from Google that allows you to track your website visitors, analyze their habits, traffic sources, social metrics and many other different data. By analyzing the statistics of your site, you can create the content you need for your visitors. In this tutorial, you will learn how to sign up and add a Google Analytics Tracking ID in WordPress.

    Why is Google Analytics in WordPress needed?

    It probably becomes much easier when you know what your visitors want from you and your site? In order for them to come back to your site again and again, you need to provide them with what they want. This is exactly what Google Analytics does. Here are just a few reasons to add Google Analytics to your website and why every WordPress site must have it:

    1. It helps in determining the behavior of your users. Yes, you will be able to virtually track your users' behavior through Google Analytics. You can easily check the most viewed pages, the average view time of each page, and even determine which page is causing your users to leave your site. Of course, viewing this information will help you optimize your site. For example, if a certain article attracts a large number of visitors, you can publish more articles on similar topics and attract more traffic.
    2. It helps you analyze the most active times on your site. You can easily determine the time period with the most traffic. For example, if the majority of your users are active at night, it is obviously better to postpone the publication of your posts to a later time.
    3. It helps you explore important data. Google Analytics can provide you with the smallest details - from the location of visitors, to the language they speak, from the browsers they use, to screen resolution and the like. This will certainly help you better understand your audience.

    While there are several other analytics services that you can use, Google Analytics provides a wide range of exclusive features. Let's take a quick look at each of them:

    1. Convenient creation of custom reports. The best way to analyze your users' behavior is to extract useful information from facts and figures. Having a convenient function for creating custom reports will undoubtedly help you with this. You can add various settings and metrics to your report to get the most out of your data.
    2. Setting up custom alerts. This is a really awesome piece of Google Analytics to help you set up a custom alert to be sent in the form of text or email whenever there is a drop or sudden change in traffic. Thanks to this feature, you no longer need to keep track of the updates of the data you need in the control panel.
    3. Integration with Search Console. It is very important to keep track of the statistics and numbers related to SEO. Search Console is one such tool that provides you with important information about search engine optimization. Search Console integration with Google Analytics makes information more accessible and accessible from the same place.

    These are just a few of the Google Analytics features that make the WordPress process a breeze!

    How does Google Analytics work?

    You might have thought that the data that Google Analytics provides is incredible. But how does he do it all? Well, a basic knowledge of how software works helps you to use it more efficiently. The Google Analytics process can be described in three stages:

    1. JavaScript code. When a user lands on your site, JavaScript starts executing, which collects all the necessary information about the site itself and information about the visitor: the browser from which he entered, the operating system, screen resolution, etc.
    2. Data collection service. Once the information is collected, it is sent to Google servers in the form of small packets called hits. These hits are sent every time a visitor opens your site.
    3. Data processing. During data processing, Google Analytics servers turn the raw information into useful statistics for you. For example, they distribute your users based on their location, language, screen resolution, device type, and more.

    This is how it works. The whole process may seem quite easy, however, most of the complex processes of collecting and forming information are hidden from view.

    Hopefully this has only strengthened your desire to add your site to Google Analytics. Here's a quick guide to show you how to sign up and add your site to Google Analytics on WordPress.

    Before you start this tutorial, you need the following:

    Step 1 - Creating a Google Analytics Account

    The first thing you need to do is create a Google Analytics account and get your tracking code. The steps below will show you how to sign up for Google Analytics:

    1. Go to the page Google analytics... Click the button Register now, which is located in the upper right part.
    2. You will be redirected to the login page. Enter your email address and click the button Further... If you do not have a Google account yet, create one by clicking on the button Create an account.
    1. On the next page, enter the password and click the button To come in.

    1. Click the button registration to continue.

    1. To create a new account, you need to enter the following information:
    • Account name.
    • Name of the site.
    • Website url.
    • Industry.
    • Time zone of reports.

    Fill in all the required details and click the button Get Tracking ID... On the next page you will be asked to accept the License Agreement, click the button Accept.

    That's all! You have successfully created a Google Analytics account. You should now see the Google Analytics Universal tracking code:

    This code is the same for all sites. The only difference is the unique identifier ( UA-00000000-1). Yours should be on the same page. Google Analytics Tracking ID starts with UA, which stands for Universal Analytics, the first set of numbers represents the account number ( 00000000 ), and the last number stands for the Google Analytics property ID ( 1 ).

    Step 2 - Adding Google Analytics Tracking ID Code in WordPress

    There are several ways to add Google Analytics Tracking ID in WordPress: using a plugin, adding the tracking script directly to the file header.php or by creating a new function in the file functions.php.

    Option 1 - Using a plugin

    If you are not familiar with the structure of WordPress and PHP files, this is the recommended option. One of the best plugins for this is Analytics Code Integration... This plugin will add the Universal Analytics tracking code automatically - you only need to enter your Google Analytics account tracking ID.

    The steps below will show you how to install the plugin and add your Google Analytics account tracking ID:

    1. Log into your WordPress dashboard and install the plugin Analytics Code Integration... Follow if you are unsure about how to install a new WordPress plugin.
    2. Once the installation is complete, go to the section Settings and click on Google Analytics Code.
    3. Insert your tracking ID Google analytics in the box and click Save.

    1. That's it, the tracking code has been successfully added to your WordPress.

    Please note that it takes 12 to 24 hours for the first Google Analytics results to update and start showing. After that, in the tab Google Analytics reports statistics about your audience will be presented.

    Option 2 - Add code to header.php

    As stated earlier, there are several ways to add Google Analytics code to your WordPress site. For example, the code can be added to the file header.php your theme:

    1. Log into your WordPress admin panel and go to the section Appearance -> Editor.
    2. Open up header.php for editing.
    3. Paste the tracking code you received into Step 1 before the closing tag and press the button Update file.

    THE NOTE!

    Option 3 - Create a new function in the functions.php file

    This method requires basic programming knowledge and we recommend using it only with a full understanding of your actions. Also, it is highly recommended to back up the file functions.php or even your entire site:

    1. Log into your WordPress dashboard and go to the section Appearance -> Editor.
    2. Please select functions.php from the file list on the right.
    3. The following code snippet will create a new function and insert the Analytics code along with the tracking ID right before the closing tag on your WordPress site. Paste this code at the end of the file functions.php, don't forget to change the tracking ID to yours.
    add_action ("wp_head", "my_analytics", 20); function my_analytics () (?>
  • Save changes by clicking on the button Update file.
  • THE NOTE! The Google Analytics Tracking ID must be added to your active theme. When you change the theme, you need to add it again.

    Conclusion

    Needless to say, Google Analytics is essential to understanding the audience on your WordPress site. After completing this tutorial, you have learned how to add a Google Analytics Tracking ID in WordPress.