ROIVENUE Resources
  • Welcome to Roivenue
  • 🚀Roivenue Implementation
  • ❓FAQ
  • 📈Roivenue Training
    • Core Concepts
      • AI Data Driven Attribution
      • Click-based vs. Impression-based Touchpoints
    • Roivenue Features
      • Introduction
      • Model Comparison
      • Custom Dimensions
      • Configurable Dashboards
      • Performance Analysis
      • Filter Panel
      • Bookmarks
      • Dimension Breakdown
      • Budget Optimizer
      • Targets
      • Other Expenses
      • Measures
      • Users Management
    • Data Exports
      • Exports Overview
      • Export to a Google Sheet
      • Export to Azure Blob Storage
      • Export to Google Looker Studio
    • Roivenue for Chrome
    • Playbook
      • How to Identify Best Performing Channels
      • Evaluating Campaign Performance Over Time
    • Roivenue Help Center
  • 💻How To
    • Transaction Data Implementation
    • UTM Parameters
    • Sharing Acesses
    • Sharing GA4 Data through BigQuery
    • Roivenue Measurement Implementation
      • Implementation through GTM
        • Main Implementation
        • Tracking Through Own Subdomain
        • Custom Pageviews Tracking
        • Conversion tracking
      • Implementation without GTM
      • Impression Tracking
      • Implementation validation
  • 🔗Connectors
    • Connectors Overview
      • Advanced Editor
      • JSON Structure Description
    • Google Ads Customization
      • Googlue Ads - Supported Columns
    • Meta Ads Customization
      • Meta - Supported Columns
    • Special Authorization Procees
      • Árukereső
      • Compari
      • Heureka
      • Shoptet
      • Sklik
  • 📖Glossary
    • Marketing and Financial Glossary
      • Delivery Ratio
      • Gross Profit
      • Gross Margin
      • Deliveries
      • Margin Return on Marketing Investment (mROMI)
      • Cost Per Click (CPC)
      • Impressions
      • Marketing Investment Ratio (MIR)
      • Marketing Profit
      • Return on Marketing Investment (ROMI)
      • Cost Per Impression (CPI)
      • Clicks
      • Conversion Rate
      • Cost Per Thousand Impressions (CPT)
      • Cost of Goods Sold
      • Cost Per New Customer Acquisition (CPA)
      • Visits
      • Click-Through Rate (CTR)
      • Average Order Value (AOV)
      • Sales Revenue
      • Return on Investment (ROI)
Powered by GitBook
On this page
  • First Part of the Query
  • Second Part of the Query
  • Third Part of the Query
  • The Whole Query

Was this helpful?

  1. Connectors
  2. Connectors Overview

JSON Structure Description

Have you ever wondered what is happening in the complex code of a connector? Read more to crack this shell open.

PreviousAdvanced EditorNextGoogle Ads Customization

Last updated 1 year ago

Was this helpful?

Let's split the JSON into three parts to understand the logic from beginning to the end. We won't describe every given parameter as some of the parameters are more important to us than to you. If you want to customise your queries by yourself than you should read and understand this.

First Part of the Query

Every template starts with defining the query:

  • naming and scheduling the connector

  • what the connector does and where the data will be stored (outputCode and Storage)

  • and other parameters, that are less important for you and more important to us

Second Part of the Query

The magic starts to happen from the second part of the code, because the source, dimensions and metrics of the query are defined here.

The source is defining what platform the query will target.

Parameters specify exactly what dimensions and metrics will be downloaded. In this case, there is the: Date, Source/Medium, Campaign and Ad Group dimensions and from metrics there are: Sessions, Hits, Entrances, Bounces, Pageviews, Users, New Users, Conversions and Conversion Value.

In other words, you are listing which metrics from the API's platform you want to download.

Note: The structure must follow the naming conventions of the platform.

Third Part of the Query

The third part of the query is very dependent on the second. In the second you specified what you want to download from API, but in the third, you need to define what will ROIVENUE do with the data and how it will manage it.

You can imagine this step as building columns in an Excel file. See this example:

You can see the repetitive structure of every column. Look at one of the most typical metrics from Google Analytics (sessions)a below.

  • With code you are telling the JSON to create a column with the name sessions.

  • The datatype is what kind of data are you storing in the cells. Long is a value, that tells the JSON to store integers in it.

  • The conceptType is saying if the field is metric or dimension.

  • SemanticType tells you how and in which format the field should be threaded.

  • The source parameter is referring to the source parameter from the second part of the query. The connector checks if the value in the source field refers to the same field from the second part and if yes, it populates the column with that data.

Note: You need to refer to the source parameter without the "ga:" prefix. Otherwise, the connector would fail.

The Whole Query

Now you should be able to understand the logic of your JSON queries. The skeleton of every JSON stays the same, but the parameters can vary from platform to platform.

[
	{
		"name": "GASessionsDailyQuery",
		"comment": "Ga Sessions daily",
		"info": {
			"schedule": {
				"startDate": "0001-01-01T00:00:00",
				"mode": "oneTime"
			},
			"outputCode": "GaSessionsDaily",
			"output": {
				"partitionKeys": [
					"date"
				],
				"deleteEnabled": true,
				"writeFileWhenNoData": false,
				"format": "csv",
				"storage": "azureBlob",
				"gzip": false,
				"relativePath": "connector/ga/gasessionsdaily_{startDate}-{endDate}_at_{execTime}{extension}",
				"dateColumn": "date",
				"isSortedByDate": true
			},
			"source": {
				"type": "Source.GoogleAnalyticsSource",
				"parameters": {
					"dimensions": [
						"ga:date",
						"ga:sourceMedium",
						"ga:campaign",
						"ga:adGroup"
					],
					"metrics": [
						"ga:sessions",
						"ga:hits",
						"ga:entrances",
						"ga:bounces",
						"ga:pageviews",
						"ga:users",
						"ga:newUsers",
						"ga:%%conversions_metric%%",
						"ga:%%conversionValue_metric%%"
					],
					"sort": "ga:date"
				}
			},
			"transforms": [
				{
					"type": "Transform.Columns",
					"parameters": {
						"columns": [
							{
								"code": "date",
								"dataType": "datetime",
								"conceptType": "dimension",
								"semanticType": "date",
								"expression": "ParseGaDateToDate(date)"
							},
							{
								"code": "webSource",
								"dataType": "string",
								"conceptType": "dimension",
								"semanticType": "dimension",
								"expression": "sourceMedium.Split(new [] {'/'}).First()"
							},
							{
								"code": "webMedium",
								"dataType": "string",
								"conceptType": "dimension",
								"semanticType": "dimension",
								"expression": "sourceMedium.Split(new [] {'/'}).Skip(1).First()"
							},
							{
								"code": "webCampaign",
								"dataType": "string",
								"conceptType": "dimension",
								"semanticType": "dimension",
								"source": "campaign"
							},
							{
								"code": "webAdgroup",
								"dataType": "string",
								"conceptType": "dimension",
								"semanticType": "dimension",
								"source": "adGroup"
							},
							{
								"code": "sessions",
								"dataType": "long",
								"conceptType": "metric",
								"semanticType": "metric",
								"source": "sessions"
							},
							{
								"code": "entrances",
								"dataType": "long",
								"conceptType": "metric",
								"semanticType": "metric",
								"source": "entrances"
							},
							{
								"code": "bounces",
								"dataType": "long",
								"conceptType": "metric",
								"semanticType": "metric",
								"source": "bounces"
							},
							{
								"code": "hits",
								"dataType": "long",
								"conceptType": "metric",
								"semanticType": "metric",
								"source": "hits"
							},
							{
								"code": "pageViews",
								"dataType": "long",
								"conceptType": "metric",
								"semanticType": "metric",
								"source": "pageviews"
							},
							{
								"code": "users",
								"dataType": "long",
								"conceptType": "metric",
								"semanticType": "metric",
								"source": "users"
							},
							{
								"code": "newUsers",
								"dataType": "long",
								"conceptType": "metric",
								"semanticType": "metric",
								"source": "newUsers"
							},
							{
								"code": "conversions",
								"dataType": "decimal",
								"conceptType": "metric",
								"semanticType": "metric",
								"source": "%%conversions_metric%%"
							},
							{
								"code": "conversionValue",
								"dataType": "decimal",
								"conceptType": "metric",
								"semanticType": "metric",
								"source": "%%conversionValue_metric%%"
							},
							{
								"code": "currencyCode",
								"dataType": "string",
								"conceptType": "currencyCode",
								"semanticType": "currencyCode",
								"source": "currencyCode"
							}
						]
					}
				}
			]
		}
	}
]

We currently provide tutorials for adjusting JSON in templates to these platforms:

🔗
Google Ads
Facebook Business Manager
Shortened third part of JSON