Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have my site here and I would like to track it's visits however the code I have in there now is not working (I've had it successfully"tracking" for days now but no data has been shown.
I've purchased a domain name and am pointing it to a subdomain of a hosting account I have. I've followed tutorials & read articles, but almost everything is outdated and it's not even working. What is a good method of setting up google analytics for a sub domain that a newbie with google analytics can follow or understand?
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-32557751-2']);
_gaq.push(['_setDomainName', 'priscilla.ambergoodwin.com']);
_gaq.push(['_addIgnoredRef', 'ambergoodwin.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
I have my website account and then I've added a profile to it called "sub domain tracking" & given it a fliter. Below are the images of my account and profile and settings for the filter.
So I just dont understand what I'm doing wrong.
The best way to track sub-domain is to add new website under this account and generate new analytics code for this sub-domain only. Just insert the newly created code into all pages of this sub-domain and it will start working fine for sure.
Regarding to same account; it will be complex process and you will have to follow different steps provided here https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite
Did you try Googling this before you posted here? There are lots of resources on how to track subdomains. Here's one: http://theanalyticsguru.wordpress.com/2008/03/01/tracking-subdomains-within-google-analytics/
In short - it's not a filter within your site, it's a completely new site.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
My team kinda like TestCafe, but there are some reservations against adopting it. The main one being support for Gherkin integration. The gherkin-testcafe npm package and the sample https://github.com/helen-dikareva/testcafe-cucumber-demo seem not ready for primetime yet.
Is it a more reliable way of supporting BDD at the moment?
I'm from the TestCafe Team. Fow now, we don't plan to add this functionality in the near future. But I guess gherkin-testcafe is a nice module to start with. This is an open-source module, so there is a good chance that the community will add the required functionality. If you wish, you may go ahead and do this by yourself.
After a conversation with colleagues here at the office, we concluded that the best way to
keep our BDD process,
use TestCafe and
write tests in Typescript without adding dependencies on javascript packages that are not the most realiable
was to just use some conventions while writing the TestCafe tests. For example, let's say you are given the following Gherkin file:
Feature: Application
As an administrator
I want to be able to view and manage Applications in my account
Scenario: Verify creating and deleting an application
Given I am in the login page
When I login to console with allowed user
And I go to Applications page
And I add an application
Then the application is added in the application page
Then the feature.ts file would look something like the following:
import {Selector} from 'testcafe';
import {LoginPageModel} from '../pagemodels/login.pagemodel';
import {ApplicationPageModel} from '../pagemodels/application.pagemodel';
let applicationPageModel: ApplicationPageModel = new ApplicationPageModel();
let loginPageModel: LoginPageModel = new LoginPageModel();
fixture(`Feature: Application
As a administrator
I want to be able to view and manage Applications in my account
`);
let scenarioImplementation = async t => {
let stepSuccess: boolean;
stepSuccess = await loginPageModel.goToPage(t);
await t.expect(stepSuccess).eql(true, 'Given I am in the login page');
stepSuccess = await loginPageModel.login(t);
await t.expect(stepSuccess).eql(true, 'When I login to console with
allowed user');
stepSuccess = await applicationPageModel.selectPage(t);
await t.expect(stepSuccess).eql(true, 'And I go to Applications page');
stepSuccess = await applicationPageModel.addApplication(t);
await t.expect(stepSuccess).eql(true, 'And I add an application');
stepSuccess = await applicationPageModel.verifyAddedApplication(t);
await t.expect(stepSuccess).eql(true, 'Then the application is added in
the application page');
};
test(`Scenario: Verify creating and deleting an application
Given I am in the login page
When I login to console with allowed user
And I go to Applications page
And I add an application
Then the application is added in the application page`,
scenarioImplementation);
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Is there a google API to create google analytics code through API(not going to google site manually and create) ?
Please help...
The GA Management API is read-only. You cannot create accounts or profiles through it:
Google Analytics provides developer access to the configuration data through the Management API, which is a read-only API for account and configuration data.
To load the script using the async method you can include the ga.js file in the head programatically. This can be done in different ways but this is a common way:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);//<------ Set the account number!
// Add other values
_gaq.push(['_trackPageview']);
_gaq.push(['_setDomainName', 'www.example.com']);
_gaq.push(['_setSiteSpeedSampleRate',5]);
// The the script to the head
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') +
'.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
You can push values into the _gaq variable before or after the gs.js script is loaded. You can add many kinds of tracking for events, transactions and virtual pageviews at any point in the page. Nothing to do with usual script that get from the account. The only thing you need is the account number
Try Google's docs for more details:
http://code.google.com/apis/analytics/docs/tracking/asyncUsageGuide.html
You can not create web property id through API.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 4 years ago.
Improve this question
I set up a site with a template and the title was something they supplied as a default. When I searched for my site's title, it showed up in results, but it was with their default title. After changing it a couple days ago, my site still shows up with the default title instead of what I changed it to.
Is there any way I can force Google to update their information so the title I have now shows up in results instead of the default title?
This will refresh your website immediately:
From Web Master tools Menu -> Crawl -> Fetch as Google
Leave URL blank to fetch the homepage then click Fetch
Submit to Index button will appear beside the fetched result; click it then choose > URL and all linked pages > OK
Just wait, Google should normally revisit your site and update its informations. But if you are hurried, you can try the following steps :
Increase the crawl speed of your site in Google Webmaster Tools : http://support.google.com/webmasters/bin/answer.py?hl=en&answer=48620
Ping your website on service like http://pingomatic.com/
Submit if you have not yet or resubmit an updated sitemap of your website.
Fetching as Google works, as already suggested. However stage 2 should be - submit your sites to several large social bookmarking sites like digg, reddit, stumbleupon, etc etc. There are huge lists of these sites out there.
Google notices everything on these sites and it will speed up the re crawling process. You can keep track of when Google last cached your site (There is a big difference between crawling and caching) by going to.. cache:sitename.com
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I have an extension in the Chrome Web Store and I like knowing roughly how many people are using it via the "N users" and ratings on its page.
However, I don't really like loading the whole "product" page just to see a couple of numbers and thought I'd try to make a little widget that would display it instead. However, I can't find any API documentation for the Chrome Web Store.
I would a call like /webstore/api/v1/appid.json to exist, but the closest things I've found in searching only concern the Licensing API.
Is there an official Chrome Web Store API for user metrics?
This is no such API.
You can use Google Analytics inside an extension to track users manually.
If you don't need anything fancy, just a number of installs and users, there is My Extensions extension, it will track those numbers for you.
Copy and paste the snippet below wherever you want in the body of a html document saved with a ".php" extension.
<?php
//URL of your extension
$url = "https://chrome.google.com/webstore/detail/ddldimidiliclngjipajmjjiakhbcohn";
//Get the nb of users
$file_string = file_get_contents($url);
preg_match('#>([0-9,]*) users</#i', $file_string, $users);
$nbusers = str_replace(",", "",$users[1]);
echo $nbusers; //Display the number of users
?>
You can also do this client-side only (at least on your end) by using a cross-domain tool. This snippet will grab the number of users displayed on the Chrome webstore page for an extension (up-to-date as of April 28, 2018):
var chromeExtensionWebstoreURL = 'https://chrome.google.com/webstore/detail/background-image-for-goog/ehohalpjnnlcmckljdflafjjahdgjpmh';
$.getJSON('http://www.whateverorigin.org/get?url=' + encodeURIComponent(chromeExtensionWebstoreURL) + '&callback=?', function(response){
var numUsers = ((""+response.contents.match(/<span class="e-f-ih" title="([\d]*?) users">([\d]*?) users<\/span>/)).split(",")[2]);
console.log(numUsers);
});
In the future, Google may change the class name of the user count span, in which case you just need to update the regex appropriately.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'd like to gather user data in a web-based intranet application similar to rapportive, gist and xobni. These services gather and display facebook profiles, twitter streams, linkedin profiles, etc. based on the user's email address in your inbox.
Is there a 3rd party library or API (free or paid) that would provide this kind of data from social networks based on a person's email address? I'd rather not have to go through and create calls for all these different services, not to mention maintaining all these APIs. If there is already a service out there that does the work of search and aggregation that would be so useful.
The application is in C#, so a C# library or wrapper for the API would be nice but definitely not a requirement.
Rapleaf... that is the magical service that you can use to find social media data. They have both batch and API REST services.
Yes Rapleaf appears to be the way to go. But applying for the API key appears to take some time; they may or may not grant an API key. any experience with this?
If you're a somewhat industrious coder and you only have a select few social networks to search, it isn't so difficult to write simple library functions to access their APIs yourself. They all have different limits on how much searching you are allowed to do, so keep the idea of throttling in mind.
Here's an example of a php function I use to search for people Batchbook by email address, you should be able to modify this to get data from most typical REST APIs:
function getBatchbookContacts($orgname, $apikey, $emailSearch, $page) {
$url = "https://{$orgname}.batchbook.com/api/v1/people.json?auth_token={$apikey}&email={$emailSearch}&page={$page}";
$request = new HttpRequest($url, HttpRequest::METH_GET);
$request -> setContentType('application/json');
try {
$response = $request -> send();
if ($response -> getResponseCode() == '201' || $response -> getResponseCode() == '200') {
$result_json = $response->getBody();
return $result_json;
} else {
throw new Exception($response -> getBody(), $response -> getResponseCode());
}
} catch (HttpException $ex) {
throw new Exception('Internal Server Error: ' . $ex -> getMessage(), 500);
}
}