Google Analytics Experiments always chooses original variation? - google-analytics

I'm setting up a multivariate test through Google Analytics. I created the experiment through the API, and everything is looking like its running, however, only the original is being selected and the variants aren't being served.
I've tried using incognito windows, and had a few other people visit the page as well, but everyone receives a page with ?utm_expid=XXXXXXXX-XX.YYYYYYYYYYYYYYYYYY.0 on the end, where the .0 seems to indicate "show original."
Any ideas why an experiment might always show the original? Here's my experiment as retrieved through the API.
{
"id": "YYYYYYYYYYYYYYYYYYYYY",
"kind": "analytics#experiment",
"accountId": "AAAAAAAA",
"webPropertyId": "UA-ZZZZZZZZZ-0",
"profileId": "XXXXXXXX",
"name": "Product Page - Grid Content",
"description": "Test of product page grid content.",
"created": "2013-11-22T15:53:32.634Z",
"updated": "2013-11-22T16:27:15.406Z",
"objectiveMetric": "ga:timeOnSite",
"optimizationType": "MAXIMUM",
"status": "RUNNING",
"startTime": "2013-11-22T16:00:37.367Z",
"rewriteVariationUrlsAsOriginal": true,
"winnerConfidenceLevel": 0.95,
"minimumExperimentLengthInDays": 7,
"trafficCoverage": 1,
"equalWeighting": true,
"variations": [{
"name": "Newest Products (Original)",
"url": "http://mystore.com/product/pastel-lipstick",
"status": "ACTIVE",
"weight": 0
}, {
"name": "Most Popular Products",
"url": "?",
"status": "ACTIVE",
"weight": 0
}, {
"name": "Related Products",
"url": "?",
"status": "ACTIVE",
"weight": 0
}],
"servingFramework": "REDIRECT",
"editableInGaUi": true
}
UPDATE:
I've suspected this might have something to do with those weight: 0 fields under variations[]. I'm not entirely sure why they appear as weight: 0, or whether that actually prevents variations from showing.
Originally, I wanted to set url: "?" for my variations because I wanted to avoid polluting my query string. Instead of using different URLs/query string variables to determine which variation to show, I used the utm_expid query string variable the GA Experiment redirect adds to determine which variation to show. Although the API accepted these URLs without issue, I'm not sure they're actually considered 'valid.' So I tried changing the URLs to be ?mvt=1 and ?mvt=2 respectively, and saw the weights changed to 0.3333 and variations serve.
Although changing the URL seems to work, does anyone have a thorough explanation for what or why this is happening?

There is an open issue on this https://code.google.com/p/analytics-issues/issues/detail?id=377. If you subscribe to that then you'll get notified when it's fixed.

Related

WooCommerce GET Requests wp-json/wc/v3/products/categories?page=1 shows random categories on each call?

Our onlineshop recently has issues getting the correct category orders over to our stock management system via API.
Whenever we test the API Calls in Postman with:
wp-json/wc/v3/products/categories?page=1
we get a completely random category order output like this:
First call:
[
{
"id": 5179,
"name": "Redmi Note 2022",
"slug": "redmi-note-2022",
"parent": 3054,
Second call:
[
{
"id": 5181,
"name": "Displayeinheit",
"slug": "displayeinheit-redmi-note-2022",
"parent": 5179,
Any advice how we can resolve this issue?
The issue has been resolved:
The problem was caused by the plugin:
https://wordpress.org/plugins/taxonomy-terms-order/

How to get Google Analytics dimension/metric description in multi-language?

I am using this API to get a list of dimensions/metrics from Google Analytics: https://developers.google.com/apis-explorer/#s/analytics/v3/analytics.metadata.columns.list?reportTy..., however, I just realized the API only supports 'uiName', 'description' in English! is that true? is there any work around to support multi-language? Thanks!
"items": [
{
"id": "ga:userType",
"kind": "analytics#column",
"attributes": {
"type": "DIMENSION",
"dataType": "STRING",
"group": "User",
"status": "PUBLIC",
"uiName": "User Type",
"description": "A boolean, either New Visitor or Returning Visitor, indicating if the users are new or returning.",
"allowedInSegments": "true",
"addedInApiVersion": "3"
}
That is true the Meta data api only returns data in english. You are going to have to translate the metadata names to your chosen language yourself after you have downloaded the data you need

To get different response for single post and multiple posts from WP REST API

Is there any option to get different type response for WordPress single Post and Posts list?
My target for posts list response as
[
{"id":1,
"date":"2017-08-20T07:26:55",
"link":"http://localhost/wordpress/2017/08/20/test-post",
"title":{"rendered":"Test post"}
},
{"id":2,
"date":"2017-08-20T07:26:55",
"link":"http://localhost/wordpress/2017/08/20/test-post",
"title":{"rendered":"Test post"}
},
{"id":3,
"date":"2017-08-20T07:26:55",
"link":"http://localhost/wordpress/2017/08/20/test-post",
"title":{"rendered":"Test post"}
},
{"id":4,
"date":"2017-08-20T07:26:55",
"link":"http://localhost/wordpress/2017/08/20/test-post",
"title":{"rendered":"Test post"}
}
]
For single post response as
{
"id": 92,
"date": "2017-08-20T07:13:42",
"date_gmt": "2017-08-20T07:13:42",
"guid": {
"rendered": "http://devel8/wp-news/?p=1"
},
"modified": "2017-08-20T07:13:42",
"modified_gmt": "2017-08-20T07:13:42",
"slug": "hello-world-2",
"status": "publish",
"type": "post",
"link": "http://localhost/wordpress/2017/08/20/hello-world-2/",
"title": {
"rendered": "Hello world!"
},
"content": {
"rendered": "<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\n",
"protected": false
},
"excerpt": {
"rendered": "<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [],
"categories": [
1
],
"tags": [],
.....
.....
}
}
Note: using register_rest_field() and rest_prepare_post filter we can modify the response for both (single and multiple posts) But we need separately response.
OR
There is any option to know the request is made for multiple posts or single post in the get_callback function of register_rest_field().
Thanks in advance.
Since i don't get any response and solution from any one, so i had decided to develop a WordPress plugin which will meet my requirement to handle WP REST API request response for single post and posts list or multiple posts or loop of post or group of posts differently and admin can control from back end.
After long struggle i have developed the plugin named as
One Call – WP REST API Extension
Core features of plugin are
Custom and back end control rest api prefix such as ‘test-api’ where
‘wp-json’ is default to initially secure the api call.
Get different reponse for list posts and single post responses.
For posts list (multiple) call, you can control ‘one_call’ fields
from back end.
WordPress Posts fields filtering options from back end for posts list
(loop of Posts).
Hope this plugin help others like me who has plan to develop mobile application for WordPress Website using Ionic, Phonegap,React Native, Framework& and NativeScript etc.

Adobe Analytics API - Real Time Classification

I need to get from Omniture real time API a classify eVar, exclude some value, and then breackdown its with sitesection.
I try with this query:
{
"reportDescription": {
"source": "realtime",
"reportSuiteID": "**RSID**", //MY REPORT SUITE
"metrics": [{
"id": "instances"
}],
"elements": [{
"id": "evar", //MY EVAR
"top": 100,
"classification": "Real Time", //CLASSIFICATION NAME
"search": {
"type": "NOT",
"keywords": ["somevalue"] //THE VALUE TO EXCLUDE
}
},{
"id" : "sitesection",
"top" : 1
}],
"dateGranularity": "minute:1",
"dateFrom": "-1 minute"
}
}
But in the JSON response I see "somevalue" how if it not excluded.
The strange thing is that if I remove the "breakdown" (with sitesection) the classification filter seems to works fine.
I can't use classification filter if a breackdown is used in real time report? I can't find any documentation about that.
An other thing is that if I request a report with the classification, without any search, I receve the response but there is a lot of "::Unspecified::". The problem is that the "::Unspecified::" seems to be the last datas that Omniture receves form my webpages. I think this means that classifications are not in real time, also if you can to use it in real time report.

/film/film/runtime always returns null

Whenever I try to query for the length of a film I get lists of null. The query I use is directly from the "Build query" button on their site and looks like this:
[{
"id": null,
"name": null,
"type": "/film/film",
"/film/film/runtime": []
}]
Ufortunately all the responses I get look like this:
{
"name": "4D Man",
"type": "/film/film",
"/film/film/runtime": [
null
],
"id": "/en/4d_man"
}
I can hover over the links you can see on the query page and see the runtime (in this case 85 minutes) but as you can see all I get from the query is null. This may be a Freebase bug, but any help is appreciated. Thank you.
There's not a single runtime of a film, the same film can have different runtimes (original version, director's cut, etc...) Freebase use the film_cut type to contain the different runtimes of a movie
You can use this query to get the runtimes:
[{
"id": null,
"name": null,
"/film/film/runtime": [{
"runtime": null
}]
}]
Tune this query to your needs, you may need type_of_film_cut or film_release_region.

Resources