Jak dodać śledzenie konwersji formularza contacform7 dla wordpressa?

1) Instalacja pluginu


2) Edycja KODU (przekierowanie)  NIE DZIAŁA!!

The simplest way is utilizing Contact Form 7’s custom DOM event to run JavaScript. The following is an example of script that redirects you to another URL when the wpcf7mailsent event occurs:

document.addEventListener( 'wpcf7mailsent', function( event ) {
    location = 'http://example.com/';
}, false );

Embed this snippet into your theme’s template file. Obviously, you need to replace the http://example.com/ in the code to the URL you want to redirect to.

3. event




Event Tracking

Contact Form 7’s AJAX form submission can be tracked as an event. You can send a contact form submission event to Google Analytics with the following JavaScript function call:

ga('send', 'event', 'Contact Form', 'submit');

You don’t need to edit any JavaScript files to run this code because you can utilize on_sent_ok action hook, explained in the next section.

Using on_sent_ok

Contact Form 7 provides a JavaScript action hook called “on_sent_ok” to specify a JavaScript function that you’d like to run after a form submission successfully completes.

To set the event tracking code mentioned above to the hook, open the Additional Settings tab in the contact form editor screen, and insert the following line into the field:

on_sent_ok: "ga('send', 'event', 'Contact Form', 'submit');"

Don’t forget to quote the code properly, and make sure all of the code is on one line.

That’s it. Now, if you have set up everything correctly, Google Analytics will track successful form submissions through the contact form as an event with “Contact Form” as the event category, and “submit” as the event action.

To verify this is working correctly, you can check the Behavior > Events > Overview report page on Google Analytics 24-48 hours after a submission. At that point, you should be able to find tracked events there.





dodatkowo w sekcji head:

Usunięcie transakcji ecommerce z Google analytics (Hit Boulder)

a) otwieramy hit builder  https://ga-dev-tools.appspot.com/hit-builder/

b) weryfikujemy nasze konto google analytics

c) wypełniamy „hit parameter details”

(aby wygenerować „cid” wystarczy kliknąć ikonkę obok w kształcie okrągłej strzałki)

d) dane się zaktualizują po około godzinie!

e) UWAGA! aby zmienić kwotę  o jakąś wartość, wpisujemy ją, aby zmniejszyś kwotę o jakąś wartość – wpisujemy ją z minusem. Np jeżeli przychód wynosi 1000 zł a realny przychów to 500 zł – wpisujemy -500. Natomiast jeżeli przychód wynosi 500 a powinien wynosić 1000 – wpisujemy 500.

Lista dostępnych parametrów, które można zdefiniować: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cu


1) Wykasowanie transakcji przez hit builder


2) Dodanie nowej transakcji przez hit builder


3) próba wywołania kodu na stronie w domenie (nieudana)

ga('require', 'ecommerce');
ga('ecommerce:addTransaction', {
  'id': '5592',                     // Transaction ID. Required.
  'affiliation': 'Harposoftware',   // Affiliation or store name.
  'revenue': '-2862',               // Grand Total.
  'tax': '-535.14'                     // Tax.
ga('ecommerce:addItem', {
  'id': '5592',                     // Transaction ID. Required.
  'name': 'S2G + Brian głos IVONA',    // Product name. Required.
  'price': '-159',                 // Unit price.
  'quantity': '-20'                   // Quantity.

Cofnięcie transakcji Google Analytics

źródło: http://www.analyticsmarket.com/blog/edit-ecommerce-data


Editing Transactions – Refunds, Returns, Cancellations

One of the most valuable things in Google Analytics is the ability to tie an actual transaction value to campaigns and other activities. Unfortunately, Google Analytics doesn’t take into account refunds, returns or cancellations. If there are enough of these, you may find that your ecommerce reports don’t line up with reality.

The good news is there is a clean way of editing transactions after they have been reported in Google Analytics. It requires some custom coding, but it will bring your reports closer to reality.

How to Edit Transactions

To edit a transaction after it’s been reported to GA you need to execute the ecommerce code again. All three elements of the code need to be there (_addTrans, _addItem and _trackTrans), and you must reference the transaction ID that needs to be modified.

When you execute the code the second time, all the values will be added to the previous order values. For example, if the original order total was $10 and you create a second transaction worth $15 using the same transaction ID, GA will report the transaction total to be $25 ($10 + $15).

It doesn’t matter if the second transaction is from a different visitor or traffic source. It will still edit the original transaction information, but with some caveats (explained below).

Add Items To an Order

To add items to a transaction, call _addTrans, using the same transaction ID and using the additional shipping, tax and total costs.

Then call _addItem as normal for each new item you are adding. If you are adding more of an item that was in the original order, pass all the same information and for quantity just list the additional number, not the new total. (eg. A visitor orders one hat in their first order. Later they ask for two more hats. You would call _addItem the second time with quantity two. In the reports, it will show three total hats for the transaction.)

Delete Items From an Order

To delete items from a transaction without canceling the entire transaction, call _addTrans, using the same transaction ID and giving negative numbers for shipping, tax and total costs. The reports will subtract these negative numbers from the original order totals to give the new order total. (eg. Original order total $10. Second order total -$3. GA will report the order total to be $7.)

Next, call _addItem for each item being deleted. Give the normal dollar amount (as a positive number), but make the quantity negative. Google Analytics will subtract this quantity (and the corresponding item cost) from the original order.

Delete Entire Transaction

To delete an entire transaction from the reports so that it won’t be listed at all, call _addTrans, using the same transaction ID and giving the same numbers for shipping, tax and total, but as negative numbers.

Next, call _addItem for each product in the order. Again, list all the information the same, but make the quantity a negative number.

The transaction ID won’t appear in the reports anymore.

Zero Out a Transaction

To zero out a transaction without deleting it entirely from the reports, follow the instructions for deleting an entire transaction with one exception: for each item, list a negative dollar amount and a positive quantity. Or, list a separate item, like „refund” with a negative dollar amount exactly equal to the order total.

Zeroed out transactions will still be reported, but with a total of $0. Drilling into these transactions will still show all the items, including the refund.


Transactions can be edited like this regardless of whether the second transaction is from the same visitor, day or traffic source. However, the second transaction will be counted as another transaction in all the transaction totals (unless the whole thing was deleted, as explained above). And it will be attributed to the second day and traffic source.

For example, imagine a visitor makes a transaction on Monday after coming to the site from a banner ad. On Wednesday you refund his order and create a second transaction in GA. Your visit will show up as a direct visit. The following will be true:

  • The original transaction value will be attributed to the banner ad.
  • The second transaction value (a negative number) will be attributed to direct traffic.
  • If the date range includes Monday but not Wednesday, the transaction will be reported as it was originally put through. No refund information will show.
  • If the date range includes Wednesday but not Monday, the original transaction will not be reported. Only the negative transaction will show.

These caveats might be good or bad, depending on your desired outcome. They are good because you can clearly differentiate between real orders and any editing you had to do afterward. You can still attribute a real dollar value to campaigns or other actions, which is probably more accurate reporting because the campaign or action during the visit probably did not cause the refund. This way you are tying the campaign to what it was designed to do, instead of blaming it for a customer asking for a refund because of a faulty product or some unrelated cause.

They are bad because you might see some funny reports for any given time period if edits aren’t done in the same day. Revenue numbers might not always exactly match up. Also, the actual value of a transaction can’t be tied back to the same user. They will always belong to two separate users.

Advanced Ecommerce

To extend these principles, some companies may find it useful (or even necessary) to automate this process with dynamic scripts that execute the JavaScript for refunds or cancellations behind the scenes. The script could make the refunds belong to a consistent traffic source, like „admin”. The JavaScript involved would be simple, but the dynamic scripting could be complex.

Wydzielenie kanału frazy brandowe

5 rzeczy, dzięki którym lepiej wykorzystasz zgrupowanie kanałów w Analytics   ” 5 rzeczy, dzięki którym lepiej wykorzystasz zgrupowanie kanałów w Analytics 5 listopada 2014 Ola Lisiecka Choć sekcja Kanały już od dawna funkcjonuje w raportach Google Analytics, nadal przez wielu odbiorców odbierana jest jako mało użyteczna. Rzeczywiście, domyślne zgrupowanie kanałów może nie realizować w […]

Śledzenie adresów z hashtagami

Źródło: http://stackoverflow.com/questions/4811172/is-it-possible-to-track-hash-links-like-pages-with-google-analytics

Is it possible to track hash links like pages with google analytics?

For example, I want index.php/#1, index.php/#2, and index.php/#3 to all show up as individual page hits with individual time spent on page.

If there is no simple way of doing this, how can I add a track event to an onclick event with jquery? Can I still receive accurate time on „page” information this way?

Are you building entire websites in a single page too? It’s super user friendly and quick, I just love it! – Dave Jan 26 ’11 at 23:14
@Dave i wouldn’t exactly call it „super user friendly”…im using it on my website just because there is no other way with the way my website works – Markasoftware Nov 26 ’13 at 2:20

up vote 85 down vote accepted

Generically, your code could look like this

_gaq.push(['_trackPageview',location.pathname + location.search  + location.hash]);

You could either bind that code to every time you have a hash change within your application, or you could use a generic hashchange plugin, that uses the HTML5 onhashchange, and some backwards compatible hacks for older browsers, and bind this code to that event, so that it fires every time your hash changes.

Using that plugin, your code could look like:

$(window).hashchange( function(){
    _gaq.push(['_trackPageview',location.pathname + location.search  + location.hash]);


UPDATE 2014:This is how you’d do this in the new Universal Analytics:

ga('send', 'pageview', {
 'page': location.pathname + location.search  + location.hash

This is how you’d do it if you’re using Google Analytics withing Google Tag Manager:

  • Go to your macros
  • Updated the URL Macro to „Fragment”
shareimprove this answer
perfect! … as long as it works (which it should). I’ll give you my pick here in a couple hours when I see hits coming in. I actually have a slide event happen on hash changes so I slapped it in there without any plugins. – Dave Jan 27 ’11 at 20:37
You can see how it sends to your account live in Chrome with this great Extension. It’s made by the Google Analytics team. chrome.google.com/extensions/detail/… – Yahel Jan 27 ’11 at 20:43
Do you guys know how to do this with google analytics universal code? – KingOptimizer Mar 11 ’14 at 5:53
@Yahel – Thanks for your reply! I am sorry, I should have explained more. Google universal analytics is currently plugged into GTM. Do you know how I can adjust this using Google Tag Manager? – KingOptimizer Mar 12 ’14 at 0:21
This answer didn’t make it clear if this was a „hack” or not, and the original way uses a bunch of underscore-prefixed stuff that’s often a sign of unintentional use. But at least in the case of the new „Universal Analytics” snippet this is documented by Google: developers.google.com/analytics/devguides/collection/… – natevw Dec 22 ’15 at 21:16

Google Analytics allows you to track custom events, for example AJAX page loads.

(The usual caveats apply when doing this – hopefully there are non-javascript ways to access the same data 🙂

shareimprove this answer
This is not what Custom Events are for. They are for non-page actions. If your site uses hash changes to do what normal page loads do, you should use virtual page views. Custom Events are for tracking things that don’t fit the traditional pageview paradigm. – Yahel Jan 27 ’11 at 6:03

Good question. To track the hash link, you must track an event or a pageview, for every link to this hash. For the pageView, a sample code is below


Note: This method create a virtual page view that is summing up to the count of the pages of your site. If your site is a big html files with anchors (maybe there is a slider to this page), this method gives you an estimated of the interaction of the user with your „content”

shareimprove this answer

Looks like this might be useful too: https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications

Very helpful with clear ‚What to do’ and ‚What not to do’

shareimprove this answer

For new universal tracking this doesn’t work anymore. You will have to go to https://developers.google.com/analytics/devguides/collection/analyticsjs/events and update to something like

ga('send', 'event', 'category', 'action', {'page': '/my-new-page'});

Usunięcie ruchu spamowego wg lunametrics

Say Goodbye to Exclude Filters in Google Analytics!

Say Goodbye to Exclude Filters in Google Analytics!

By /

March 11, 2014

Use Google Tag Manager to Protect Your DataNo need to panic, Exclude Filters aren’t going away anytime soon! However, after reading this post you may not WANT to use Exclude Filters as frequently.  There are still many valid reasons why you may need to set them up, but when possible – it might be time to eliminate them.

Just as a quick refresher, you can use the Exclude Filters in Google Analytics to block traffic data from certain sources from showing up in a particular view.  Sometimes these are used to partition data into one view or another, for example, think of creating separate views for Internal or External Traffic.  For these use cases, Filters work beautifully. You can filter based off of IP Address, Hostname, Service Provider, etc…

But then there are those occasions where you want to block out traffic completely.  Just as easily, you can set up an Exclude filter for each of your views, and poof! The data has disappeared!  Except, it hasn’t really.

The raw, unfiltered data is stored by Google Analytics. Anytime you request a more specific report, either by adding a secondary dimension or applying an Advanced Segment, GA will go back to that unfiltered data to rerun your report, then filtering the results for your specific view.  Why is this important?

Even filtered data will increase sampling in your reports.

If you try to run a non-standard report that includes more than 250K visits/sessions, Google Analytics will use a sampling algorithm. So all of this raw data you think you’re filtering out is actually going to continue to stick around and cause sampling issues for you. Click here for more information about how sampling works with Google Analytics.

In cases where you want to filter out traffic completely, my advice is to stop sending that data to Google Analytics.

The answer here is Google Tag Manager. If you’re not familiar with Google Tag Manager, we’ve got a few articles on our blog that will help get you up to speed. Long answer short, we love it here and it will change your (analytics) life.

Let’s go over how data gets from your website into Google Analytics. In a standard implementation, using Google Tag Manager and Google Analytics, the following order of steps happen.

    1. Visitor Reaches Your Page
    2. Google Tag Manager Loads
    3. GTM Executes a Google Analytics Tag
    4. Pageview Is Sent to Google Analytics
    5. Google Analytics Receives the Pageview
    6. GA Applies Any Filters for Each View against the Pageview
    7. Pageview Shows Up In Your Analytics

Rather than waiting until the Pageview hits the filter to decide that it’s not what we want, I propose we recreate the Exclude Filtering rules using custom Macros and Rules in Google Tag Manager.  If we can determine that we don’t want a particular visitor to show up in our Analytics, let’s not even serve them the Google Analytics tag. We’ll use Google Tag Manager as a shield in this situation, to keep that data out of our analytics entirely.

If there’s a reason you want to see this data in the Google Analytics interface, let’s say from a development site or from internal traffic, once your rules are created you can always serve it a different Analytics tag or use a dynamic Macro to change the UA number, so that it won’t count against your main property’s reporting limits.

Note: It will still be helpful to have Exclude Filters on your account as a backup. This blog post will help keep traffic from reaching your account, but it won’t stop traffic from any sites that aren’t loading your Google Tag Manager.

So let’s get down to business. Two of the more popular Include/Exclude Filters are based on Hostname or on IP Address.

Using Google Tag Manager to Exclude by Hostname

First up, we can create a Macro/Rule in Tag Manager that we can use to block anything that isn’t our main site. For this example, let’s assume that our site has the following subdomains:

We only want the traffic to our main site to be sent into Google Analytics. We can do this through a simple Macro and a new Rule.

Create the “url hostname” macro

URL Hostname Macro

1. In Tag Manger, click the New button and choose Macro to start a new macro.

2. Name this Macro “hostname”

3. Select URL as the type of Macro.

4. Select Host Name as the Component Type.

5. Save!

Create the Rule – “Traffic – Bad Hostname”

Bad Hostname Rule

In Google Analytics, we have the option of using Include or Exclude. We could do the same thing here, but I’ve found that it’s much easier to create this rule as a standalone rule and use it to Block tags from firing. If you wanted to, you could add it to all the Rules that control firing, but then you’re duplicating the same logic over and over.

I’m calling this macro “Traffic – Bad Hostname” as a catchall for any hostname that isn’t www.mysite.com or mysite.com.

1. Click the New button and choose Rule to start a new rule.

2. Name this Rule “Traffic – Bad Hostname”

3. Choose the “url hostname” macro from the drop down list.

4. In the next box, choose the “does not match RegEx” option

5. In the next box, enter the following regular expression. This accounts for the fact that sometimes my site can be loaded with or without the www.

Use that Rule to Block Tags from Firing

Block By Hostname

Now that we know this traffic isn’t the general public coming to our main site, we can safely block certain tags from firing. In this case, that will be the basic Google Analytics tracking tag.

1. Open the tag you want to block with this rule.

2. Under Blocking rules, click Add

3. Select the “Traffic – Bad Hostname” rule

4. Save!

Using Google Tag Manager to Exclude by IP Address

Now that we’ve set up our Exclude by Hostname capabilities in Tag Manager, let’s look at IP Address. This one is a little harder to implement and will require some server-side logic. By default, IP Addresses aren’t available through javascript on a webpage. Depending on the platform your site is running on, this should be fairly easy to implement. You’ll need to look up the appropriate way to get the visitor’s IP address depending on how your site is configured. Once you get that IP address, then it’s time to write it to the dataLayer.

Google Tag Manager utilizes something called the dataLayer to pass information from the page into Tag Manager.  For more information, check out this post about unlocking  the dataLayer. The idea here is that you collect any sort of information about the visitor, the session, etc… and write it on the dataLayer when the page loads. When Google Tag Manager loads, it can see this information and using Macros, use this information to for Rules and other Macros.

For the IP Address Exclude, I’ve created a more complicated Macro to allow you to identify multiple types of visitors by their IP addresses. This will let you use these types of visitors in Firing and Blocking rules.

Add IP Address to the dataLayer

The dataLayer needs to be loaded ABOVE the Google Tag Manager snippet, so that this data is available when Tag Manager loads. You can use something like the following code:

Create the visitorIP Macro

Visitor IP Macro

1. In Tag Manager, click the New button and choose Macro to start a new macro.

2. Name this Macro “visitorIP”

3. Select Data Layer Variable as the type of Macro.

4. In the Data Layer Variable Name, enter whatever you called the IP Address. In my case, this would be visitorIP.

Create the visitorType Macro

Visitor Type Macro

1. In Tag Manger, click the New button and choose Macro to start a new macro.

2. Name this Macro “visitorType”

3. Select Custom Javascript as the type of Macro.

4. Paste in the following code.

5. Alter the code to suit your needs.  Regular expressions will come in handy here, just like in Google Analytics Filters.

6. Save!

Create the Rule – “Traffic – Not External”


Traffic Not External

Again, I’ll create a rule as catch-all for everything that is not our “external” visitors that we want to track. It might be helpful at some point to create special rules for different visitor types, but in this case, I’ll lump them all together.

1. Click the New button and choose Rule to start a new rule.

2. Name this Rule “Traffic – Not External”

3. Choose the “visitorType” macro from the drop down list.

4. In the next box, choose the “does not equal”

5. In the next box, enter the word “external”

Use that Rule to Block Tags from Firing

Block by Not External

If we can use IP Addresses to identify visitors as not the general public or to identify traffic that we want to block completely, we can use this rule to block any tag from firing.

1. Open the tag you want to block with this rule. In this example, we’ll block Google Analytics from even firing.

2. Under Blocking rules, click Add

3. Select the “Traffic – Not External” rule

4. Save!

General Conclusions

So there you have it, two ways to use Google Tag Manager to shield your Analytics data from unwanted traffic. To leave with a few extra points, I’d like to point out that having this sort of capability inside of Google Tag Manager can extend way beyond just blocking the Google Analytics tag from firing. Consider the following scenarios:

  • Surveys/Pop-Ups –  If you’re using a Tag to launch 3rd party surveys or ads, chances are you’re receiving some sort of report about how well they’re performing. It would make sense in this case to block these tags from even firing for Internal Employees, which should help improve your response/clickthrough rate.
  • E-Commerce – With your new Macros and Rules, you can effectively block any test transactions from Internal Traffic from ever getting to Google Analytics.
  • Separate Properties – Sometimes you want to see the data going into Google Analytics to make sure everything is working properly. Consider using a test property with a different UA number for all testing/QA. This way your test data isn’t contributing to increased sampling and you can safely monitor your test cases. You can use these Macros to block one tag from firing, and the trigger another tag to fire instead.

Last note of caution – if you have a high traffic site and you’re constantly hitting sampling, this fix may not do much to help your situation. Consider Google Analytics Premium which increases the amount of visits you can include in your sampled reports, as well as giving you the option to request unsampled custom reports. Contact us if you’re interested in more information about Google Analytics Premium.”

Wykluczenia spamowe za M-T.pl

Wykluczenia spamowe za M-T.pl

Wykluczenia spamowe za M-T.pl

Ruch spamowy z odesłań 1

Ruch -> Wyklucz – > Odesłanie



Ruch spamowy z odesłań 2

Ruch -> Wyklucz – > Odesłanie



Ruch spamowy z odesłań 3

Ruch -> Wyklucz – > Odesłanie



Nowe nowości

– Introducing the new Google Merchant Center – nowy interface GMC jest już wprowadzany. Koniecznie zajrzyjcie!


– Google Analytics adopts Privacy Shield – nowość dotyczy wymiany danych między USA i EU


– Jak przyciągać odpowiednich odbiorców? Z Google Analytics i listą remarketingową! -dobry tekst o właściwym targetowaniu reklam. Warto zajrzeć!


– Google Tag Manager – Google udostępnił nowe funkcjonalności! – omówienie kilku nowych funkcjonalności GTM

Google Tag Manager – nowe funkcjonalności!

– Jak zmierzyć ruch z urządzeń mobilnych – warto zajrzeć!


– HEY IDIOT! YOU’RE READING YOUR GOOGLE ANALYTICS ALL WRONG! – Jak czytać dane w Analytics. Warto zajrzeć!


– 3 Tips for Better PPC Competitor Analysis – jak analizować konkurencję w AdWords

3 Tips for Better PPC Competitor Analysis

evamped User Interface In Google Tag Manager – jak wygląda i jak działa nowy interface i funkcje GTM. Warto zajrzeć!

Revamped User Interface In Google Tag Manager