Ta kontakt med oss

MARKNADSFÖRING

The Ultimate Guide to Google Data Studio in 2020

Publicerad

The Ultimate Guide to Google Data Studio in 2020

Having the ability to visualize data helps you unlock invaluable insights for better decision-making in your business and gives you a serious advantage when it comes to getting competitive opportunities.

While many tools can help you visualize data, none compare to Google Data Studio, which is entirely free and accessible to all (even if you don’t have any data of your own!). Like most Google tools, Data Studio can be hard to master, but it’s well worth it. Once you’ve gotten comfortable with its features, you can use it to create stunning and informative reports for your clients, coworkers, or leadership team.

This guide will walk you through the most useful Data Studio tools. We’ll start with the basics before moving into the intermediate features. Finally, we’ll go over the advanced options.

1. Log into Data Studio

To log in to Data Studio, you’ll need a Google account — I recommend using the same one as your Analytics, Search Console, and/or Google Ads account.

You’ll land on the Data Studio overview page. Click the “Home” tab to view your dashboard.

2. Explore the Data Studio Dashboard

how to use google data studio: explore dashboardIf you’ve used Google Docs, Sheets, or Drive before, this dashboard should look pretty familiar.

Reports

Here’s where you can access all of your reports (equivalent to a workbook in Tableau or Excel).

Notice that you can filter by who owns the report:

how to use google data studio: access reports

Data Sources

Data sources list all the connections you’ve created between Data Studio and your original data sources.

Data Studio currently supports 500+ data sources. Below are the most popular sources:

If you’re using Google Analytics and/or Search Console (which I highly recommend), you’ll need to individually connect each view and property, respectively.

So if you have three GA views for three different subdomains, you’ll need to set up three separate data sources.

Explorer

Explorer is an experimental tool that lets you experiment or tweak a chart without modifying your report itself.

For instance, let’s say you’ve created a table in Data Studio that shows the top landing pages by conversion rate. While looking at this table, you think, “Huh, I wonder what I’d find if I added average page load time.”

You don’t want to edit the chart in the report, so you export it into Labs — where you can tweak it to your heart’s content. If you decide the new chart is valuable, it’s easy to export it back into the report. (Jump to the section where I explain how.)

Report Gallery

The report gallery is a collection of templates and examples you can use depending on your business needs.

how to use google data studio: explore report gallery

For instance, if you run an ecommerce store, the ecommerce revenue template would be very useful.

Connect to Data

And here’s where you add data sources. (You can also add sources within a report itself.) Let’s add our first source.

How to Connect Data Sources to Google Data Studio

Here’s a step-by-step guide on how to connect data sources to Google Data Studio.

1. Start with Analytics or Search Console.

how to connect data sources to google data studio: analytics

In this example, I’ll connect Analytics — however, the process is nearly identical for other sources.

If you want to follow along exactly with what I’m doing, connect the Google Analytics Demo Account for the Google Merchandise Store.

You’ll be prompted to authorize the connection. Once you’ve done that, you’ll need to select an account, property, and view.

how to connect data sources to google data studio:  select property

You’ll be presented with something like the view below: a list of every field in your Analytics account (both the standard ones and the ones you’ve added).

how to connect data sources to google data studio: fields

Does this feel overwhelming? Yep, same here.

We could do a lot in this step — add new fields, duplicate existing ones, turn them off, change field values, etc. But, of course, we could also do all those things in the report itself, and it’s much easier there. So let’s do that.

2. Click “Create Report” in the upper right.

Data Studio will ask if you want to add a new data source to the report; yes, you do.

how to connect data sources to google data studio: create reportHere’s what you’ll see. It’s pretty spartan, but not for long!

3. Click “Add a chart” in the toolbar.

It’s time to add your very first chart. The good news is that data Studio makes it easy to compare chart types with some handy illustrations.

how to connect data sources to google data studio: add chart

4. Choose the first option under “Time series.”

For the purpose of this tutorial, we’ll start with a “Time series” chart. This chart type shows change over time. Once it appears on your report, the right-hand pane will change. Here’s what you should see:

how to connect data sources to google data studio: time series

By default, the dimension is “Date”; you can change this to any of the time-based dimensions, including “Year,” “Hour,” etc.

I will stick with “Date” because the Demo Account doesn’t have a lot of historical data.

Data Studio will automatically select a metric (i.e., what’s displayed on the Y-axis) for you. Feel free to change this; for instance, it defaulted to “Pageviews” for me, but I’d rather see “Revenue per user.”

how to connect data sources to google data studio: chart example

5. Add another metric.

First, make sure you’ve selected the chart, so you see the pane on the right:

how to connect data sources to google data studio: add metric

You have two options for adding a metric (or dimension).

You can click the blue plus-sign icon — which will bring up a search box so you can find the field you want — or you can drag a field from the right into the metric section.

To delete a metric, simply hover over it with your mouse and click the white “x” that appears.

6. To add a table, choose the third option under “Add a chart.”

how to connect data sources to google data studio: add table

My chart defaults to Medium (for dimension) and Pageviews (for metric), so I change it to Product and Unique Purchases.

And I think this table’s formatting could use some work.

Change the “Rows per page” from 100 to 20 (much easier to read) and check the box for adding a Summary row.

how to connect data sources to google data studio: rows

7. Finally, click “Style” to go to the style tab.

Scroll down and select “Add border shadow.” This is one of my favorite ways to make a data visualization pop off the page.

how to connect data sources to google data studio: add style

8. To see the finished product, click “View” in the top corner.

This transitions you from Editor to Viewer mode.

Voila!

how to connect data sources to google data studio: finished product

9. Click “Edit” to finish up and name the report.

Double-click the title (right now, it’s “Untitled Report”) to change it.

how to connect data sources to google data studio: report name

And with that, the first report is officially done. Click that familiar icon above the Chart Editor and add some email addresses to share your report.

Okay, don’t share the report just yet because I’m about to reveal the secrets that’ll help you seriously upgrade it.

Google Data Studio Tutorial

  1. Use templates.
  2. Publish your report.
  3. Connect to 150+ sources.
  4. Create your own report theme.
  5. Embed external content.
  6. Send scheduled reports.
  7. Download reports.
  8. Embed reports.
  9. Add a date range.
  10. Add filter controls.
  11. Create interactive chart filters.
  12. Add data control.
  13. Add a dimension breakdown.
  14. Use Data Studio Explorer (Labs).
  15. Create report-level filters.
  16. Create blended fields.
  17. Blend your data source with itself.
  18. Create a basic calculated field.
  19. Creating an advanced calculated field.
  20. Create a calculated blended field.

Beginner Google Data Studio Tips

1. Use templates.

There’s no need to reinvent the wheel. If you’re not sure where to start with Data Studio, I recommend browsing through their templates for inspiration.

google data studio tips: use template

Pay attention to the report’s creator. Many templates were built by the Data Studio team; you can find them all in the “Marketing Templates” section. But there are also 45+ user submissions located in the “Community” section. A few of my favorite templates:

  • GA Behavior Overview: This dashboard pulls out the most relevant information from the Behavior section of Google Analytics
  • Paid Channels Mix Report: Use this template to understand how your ads are performing on Facebook, Twitter, LinkedIn, search, and more.
  • Website Technical Performance Indicators: Get a quick overview of how your site is performing in real-time, including JavaScript and 404 errors and page load times.

There are also a bunch of fun, non-marketing templates in the gallery (found in the “Featured” section), like F1: How Important Is the First Race? och Star Wars: Data from a galaxy far, far away. Definitely take a look if you’re curious to see the full potential of GSD unleashed.

2. Publish your report.

Want to show off your superior analytics and data visualization skills to the world? Submit your report to this gallery using this Google form.

Read over the full instructions at this link, but here’s what I’d keep in mind:

  • Don’t share sensitive information. I recommend creating a report with publicly accessible data, so there’s absolutely no chance you get in trouble for sharing data you don’t own. (Pro tip: recreate one of your existing company reports with dummy data from one of Google’s sample data sets!)
  • Make it awesome. The public reports are impressive, so don’t hold back with design, features, and so on.
  • Add context. Provide on-page explanations of what you’re measuring or monitoring with captions, instructions, maybe even a video of you walking through the report.
Se även  Beyond Title Tags: 5 Worthwhile SEO Tests that Seem “Untestworthy”

3. Connect to 150+ data sources.

As I mentioned, you can bring data from Google-owned sources into Data Studio, including Search Console, Google Ads, YouTube, and Campaign Manager.

But that’s just the tip of the iceberg. There are also more than 120 partner connectors — essentially, third-party bridges between Data Studio and platforms like Adobe Analytics, AdRoll, Asana, Amazon Ads, and AdStage (and that’s just the As).

Kolla upp all the options here.

google data studio tips: connect to sources

4. Create your own report theme.

Whether your report is meant for internal stakeholders, like the leadership team, or external ones, like clients, it’ll be more effective if it looks good.

To adjust the report’s style and formatting, click the Layout and theme option in the toolbar.

Any changes here will apply across the report—meaning you only need to pick fonts, colors, etc., once versus every time, you add a new module to the report.

google data studio tips: create theme button

Data Studio comes with two built-in themes: simple and simple dark. But it’s easy to create your own — and the results are way more impressive.

google data studio tips: theme options

Click on “Customize.”

Use your brand style guide to choose primary and secondary colors, fonts, and text color. You might need to get creative here; HubSpot uses Avenir Next, which Data Studio doesn’t offer, so I went with its cousin Raleway.

If you’re creating a report for a client and don’t know their hex codes, Seer Interactive’s Michelle Noonan has an excellent tip: use a free color picker tool to identify what they’re using on their website.

You can also create a custom chart palette in this tab and edit the border and background settings.

5. Embed external content.

Just like you can bring your report to the wider world, you can also bring the wider world to your report.

You can insert Google Docs, Google Sheets, YouTube videos, and even live webpages with the URL embed feature. Embedded content is interactive, so it’s far more powerful than a screenshot.

Click “URL embed.” in the navigation bar to add content.

google data studio tips: add embed content

From there, simply paste the URL. Next, you may need to resize the box that appears to fit your content’s entire length and width.

The options here are pretty endless. One of my favorite ways to use this feature is to embed a Google Form gauging how helpful the report was for my audience:

google data studio tips: embed content example

If a section of the report needs extra context (or my viewers aren’t that technical), I’ll add a short video explaining what they’re looking at and how to interpret the results.

To personalize a report for a client, I’ll add the URL of their website, blog, and/or whatever pages they hired me to create or improve.

And for the HubSpot blogging team, I’ll add the latest version of the Search Insights Report so they can compare our progress to the results.

6. Send scheduled reports.

If you have a group of stakeholders that need to see your report regularly, consider using Data Studio’s “scheduled report” feature.

Click on the drop-down menu beside the “Share” button and select “Schedule email delivery.”

google data studio tips: schedule email delivery

First, enter your recipients’ email addresses, then choose a schedule, whether daily, every Monday, or every month.

This is particularly handy when working with customers, since you may not want to give them access to the live report.

7. Download the report as a PDF.

Alternatively, you can download your report as a PDF. This is helpful for one-off situations, like if your boss asks for a status report or your client wants to know how an ad has performed so far this month.

To download the file, click “download” on the drop-down menu.

google data studio tips: download reportData Studio gives the option of downloading your current page or the entire report. You can even add a link back to the report so your audience can dig in deeper if they’d like and add password protection to ensure your data stays safe.

google data studio tips: pdf download options

8. Embed reports.

You can even display your report on your company website or personal portfolio—which can be a great way to highlight the results you’ve gotten for a client or project.

Click the brackets icon in the upper navigation bar.

google data studio tips: embed report button

This box will pop up:

google data studio tips: embed reports

Adjust the width and the height as needed, and you’re good to go.

Intermediate Google Data Studio Tips

9. Add a date range.

Give your viewers more freedom by letting them select which dates they’d like to see information for.

For example, my reports always default to the last 30 days, but if one of HubSpot’s blog editors wants to see how their property performed in the previous calendar month, the date range controls let them adjust the report.

They can choose from predefined options, like “yesterday,” “last seven days,” “year to date,” etc., or pick a custom period.

To enable this, first navigate to the page you want to give users date control. Next, click on the drop-down menu by “Add a control.” Next, click “Date range” from the toolbar.

google data studio tips: date range control

A box will appear on your report. Drag it into the position you want — I recommend somewhere in the upper right or left corner, so your audience sees it first — and adjust the size if necessary.

google data studio tips: date range exampleClicking this module will bring up a panel to the left of your report called Date Range Properties. Set the default date range to “Auto date range,” if it isn’t already.

google data studio tips: date range properties

If your viewers select a date range using the date range widget, every report on the page will automatically update to that period.

There are two ways to override this:

  • Set a time period within a specific chart. That time period will always supersede the date range control.
  • Group the charts you want to be affected by the date range control with the module. Select the chart(s) and the box, then choose Arrange > Group.

google data studio tips: group charts

Now, only the chart(s) in this group will update when someone adjusts the date range.

Make sure this setting is clear to your viewers — otherwise, they’ll probably assume all the charts they’re looking at on their current page are using the same time period.

10. Add filter controls.

Give your audience even more flexibility with filter controls. Like the date range control, a filter applies its settings to every report on the page. So if, for example, someone filtered out everything besides organic traffic, all the reports on that page would show data for organic traffic specifically.

Add a filter control by clicking this icon in the toolbar.

google data studio tips: add filter controls

The filter will appear on the report page. Resize it and drag it into the position you want. While it’s selected, you should see a panel on the left-hand side:

google data studio tips: panel

In the data tab, pick which dimension you want viewers to filter. These dimensions come from your data source — in this example, I’ve chosen Traffic Type.

The metric part is optional. If it’s checked, viewers will see the values for each dimension sub-category in the filter. (This will make more sense once you see the screenshot below.) They can sort by these values, but they can’t filter by a metric.

You can add an additional filter to your filter control. For example, if you’ve added a filter for Source / Medium, you may want to exclude the “Baidu /organic” filter, so your viewers don’t see that as an option.

google data studio tips: additional filter controlCustomize your filter control’s formatting and appearance in the style tab. You have a few options: list/check all that apply filters, like this one:

google data studio tips: filter formatting

Or “search all” filters, which allow your viewers to search by numeric and text terms using operators like >=, and <, or “equals,” “contains,” etc., respectively.

This can be a hassle for the people reading the report—plus, they need to be somewhat comfortable with search operators. So, unless your filter dimensions have 10,000 values (unlikely), stick with the list filter.

11. Create interactive chart filters.

Want to make it even easier for your audience to filter the charts in your report? Create responsive chart filters.

This sounds fancy, but it simply means selecting a dimension in a chart will filter all the charts on that page for that dimension.

For instance, if you click on “organic” in this chart, the other charts on the page will update to show data for organic traffic only — just like you’d applied a traditional filter control.

google data studio tips: interactive chart filters

You can also create chart controls for time, line, and area charts. For example, if a user highlights say, January through March on a time chart, the other charts on the page will show data for January through March as well — just like date range control.

And also, just like filter controls, you can group chart controls.

To enable chart control, select the appropriate chart. In the right-hand panel, scroll to the bottom and check the box labeled “Apply filter.”

google data studio tips: apply filterAdd a caption next to charts that support interactive filtering, so your viewers know it’s an option:

google data studio tips: caption example

12. Add a data control.

Data controls may just be one of the coolest Data Studio features, full-stop. Place one of these bad boys on your report, and you’ll give viewers the ability to choose the source of the data being piped into your charts.

This is a game-changer for anyone managing a complex property or working with multiple stakeholders.

For instance, imagine you’re the admin of HubSpot’s Google Analytics account. You create a Data Studio report monitoring key website performance indicators, like average page speed, number of non-200 response codes, number of redirect chains, and so on.

Se även  Google driver uppdatering för att åtgärda några problematiska webbplatsnamn i sökningen

You share this report with the blogging team, who has access to the Google Analytics view for blog.hubspot.com. (Need a refresher on how views and permissions work? Check out our ultimate guide to Google Analytics.)

You also share the report with the Academy team, who has access to the GA view for academy.hubspot.com, and the Leads Optimization team, who has access to offers.hubspot.com.

To see this report populated with the relevant data, these teams simply need to select their view from the “data source” drop-down, and voila — all the charts will update automatically.

Pretty nifty, right?

google data studio tips: data control

Not only does this save you from rebuilding the same report for different groups, but it also means you don’t need to worry about accidentally sharing sensitive or confidential information. Each viewer can only select data sources they’ve been granted access to.

You can include multiple data controls in a single report.

Add the data control widget to your report by clicking this icon:

google data studio tips: data control buttonThen choose which primary source you’d like viewers to pull from:

google data studio tips: data control source

13. Add a dimension breakdown.

Instead of telling you what a dimension breakdown is, it’s easier to show you how it works.

Suppose we want to see users by source. To find out, we create a simple bar chart.

google data studio tips: bar chart

This is interesting — yet there’s some context missing. For example, is all of that organic traffic coming from Google? (Since this is U.S. data, probably, but imagine creating the same chart for China or Japan, where Baidu and Yahoo have a far greater presence.)

What about referral traffic? Clearly, we’re getting a significant number of users from referral links; is a single source driving most of them, or is it distributed fairly equally across a wide variety of sources?

We could create separate bar charts for each source — first filtering by medium and then making the dimension “Source” and the metric “Users.”

Or we could click a single button and have Data Studio do it for us.

Under Breakdown Dimension, click “Add dimension.”

google data studio tips: bar chart dimensions

Add “Source.”

Here’s what you should see:

google data studio tips: bar chart

Pretty sure my former Data Analytics professor would cry if he saw this. But don’t worry, we’re not done yet.

Jump over to the “Style” tab and check the box “Stacked bars” to turn your regular bar chart into a stacked bar chart (you should see the chart type update accordingly).

Data Studio will automatically make your bar charts “100% stacking,” meaning that every bar will go to the top of the chart. However, this style is misleading — for example, here, it suggests every medium drove the same number of users.

Uncheck this box.

google data studio tips: stacked barsNow check it out:

google data studio tips: complete stacked bars chart

14. Use Data Studio Explorer (Labs).

To bring any chart into Explorer, mouse over the space next to its top-right corner. You’ll see three vertically-stacked dots appear; click them.

google data studio tips: data studio explorer

Select “Explore (Labs).”

You’ll see something like this:

google data studio tips: explorer view

You can toggle between different visualizations; add and remove dimensions and metrics; change the date range, and apply segments.

Notera: Unlike every other Google tool out there, Explorer does not automatically save your work.

To preserve your chart, click the “Save” button on the top nav bar (to the left of your profile icon). Once you do that, your Explorer “report” will be saved in the Explorer section of your dashboard. In addition, every change you make will be saved by default.

Speaking of that dashboard, if you prefer, you can also start with Explorer (rather than a Data Studio report). Go to your Data Studio dashboard and select “Explorer (Labs)” in the left-hand menu.

google data studio tips: explorer plus button

Add a new data source by clicking the blue button in the lower right corner.

At first, Explorer confused me. It feels very similar to the core Data Studio — what was the point of having both?

However, after spending some time in Explorer, I’ve come to appreciate its unique value.

Unlike Data Studio, any modifications you make to a chart in Explorer are temporary. That means it’s a great place to dig into your data and try out different ways of visualizing it without making any permanent changes. Then, once you’re happy with your chart, simply export it back into Data Studio.

To do this, click the small sharing icon in the top navigation bar.

google data studio tips: share

Then choose whether to add your Explorer work into a new or existing Data Studio report.

Advanced Google Data Studio Tips

15. Create report-level filters.

By default, a filter applies to every chart on that page. But what if the viewer goes to the next page? The filter won’t go with them.

This is confusing for non-technical folks and inconvenient for data-savvy ones. To bring a filter up from page-level to report-level, simply right-click on it and select “Make report-level.”

google data studio tips: make report level

16. Create blended fields.

Data Studio is powerful because you can bring in 400+ sources of data into a single report. But, thanks to a new feature, blended sources, it just got even mightier.

Heads up: this will get a little technical. Stay with me, and I promise it’ll be worth it.

If you’re familiar with JOIN clauses in SQL, you’ll understand data blending right away. No idea what SQL is? Not a problem.

The best way to think about blending data is with a Venn Diagram. You have two data sets. Each data set has unique information — e.g., such as the data living in the green and blue areas.

google data studio tips: blended fields illustration

But they have (at least) one data point in common: the information in the blue-green overlap section.

This shared data point is known as a key. If your data sets do not have a key, they’re not blendable.

For example, suppose you want to compare how users behave on your website versus your app. The key is the user ID, a custom dimension you’ve created in Google Analytics that your app analytics software also uses. (Note: The key doesn’t need to have the same name in both data sources; it just needs to have identical values.)

You blend your website behavior report from GA with your app usage report. This gives you all the records from the first report along with any matching ones from the second; in other words, if a user has visited the site and used the app, they’ll be included.

However, if they only used the app but didn’t visit the site, they will not be included in the new blended data.

This is known as a LEFT OUTER JOIN. (To learn more, check out this W3Schools primer.) Why do you care? Because the order of your data sources matters.

Put your primary data source first — e.g., the one where you want all the values, regardless of whether there’s a match in your second source.

Now that we’ve gotten all that out of the way, let’s set up a blended field.

First, add a chart to your report.

google data studio tips: blend data button

Click on “Blend Data.”

This panel will pop up:

google data studio tips: blend data panel

Select your first data source on the left. Remember, this is the primary data source. Then add your second data source. Data Studio lets you add up to five data sources in a chart, but let’s stick to two for now.

Now pick your join key(s). If the field exists in both sources, it will turn green. If it doesn’t exist, you’ll see this:

google data studio tips: join keys

Remember that the key acts as a filter for the second data source. So in this example, only records that match the landing page from the GA view for hubspot.com will be pulled from Google Search Console.

Choosing multiple keys will further limit the number of records pulled from the second data source.

Once you’ve picked your join key(s), the rest of the process should feel familiar.

Pick the dimensions and metrics you want to see for your first data source. Then do the same for your second.

You can also limit the results by adding a filter or date range (or for GA sources, segments). Filters, date ranges, and segments applied to the left-most data source will carry over to the other data sources.

Once you’ve finished customizing the report, click “Save.” Congrats: you just created your first blended data chart!

If you find it easier to create two separate charts and then combine them, Data Studio offers a great shortcut.

Just select both charts, right-click, and choose “Blend data.”

google data studio tips: blend data buttonUnfortunately, Data Studio can get confused pretty quickly, so I’d still make an effort to learn how to blend data using the right-hand pane.

17. Blend your data source with itself.

Try this workaround if you’re bumping into limitations with your data source connectors: blend a data source with itself.

To give you an idea, the GA data connector only lets you add one “active user” metric to a chart, so there’s no way to see 1 Day Active Users, 7 Day Active Users, and 28 Day Active Users on the same chart… unless you blend your Google Analytics data source with itself.

Follow the same instructions as above, but instead of picking a new source for your second data source, just select the first one again.

And since all of the fields are identical, you can pick whichever join key you’d like.

Se även  HubSpot-bloggens videomarknadsföringsrapport 2022 [Data från 500+ videomarknadsförare]

google data studio tips: blending data source with itself

This option is also perfect when comparing trends across two-plus subdomains or segments.

For instance, I wanted to look at organic users for the HubSpot Blog (blog.hubspot.com) and primary site (www.hubspot.com) at the same time.

This helps me figure out if we’re growing search traffic across the board. It’s also helpful when traffic decreases — have rankings dropped site-wide, or just for the blog (or the site)?

However, you can’t add two separate “user” metrics to a chart at once… unless, of course, you’re blending data.

Create a new blended data source (following the same process as above) to set this up.

Add your first view to the left-most column, your second view to the following column, and so on.

Notera: Make sure you’re choosing views with mutually exclusive data. In other words, I wouldn’t want to use “blog.hubspot.com” as my first source and “blog.hubspot.com/marketing” as my second source because all the data for the blog.hubspot.com/marketing view is included in the blog.hubspot.com one.

Because of that overlap, we wouldn’t be able to spot trends clearly.

google data studio tips: choosing data sources for blending dataUse “Date” as the join key.

google data studio tips: join key

I added the organic traffic segment to both sources, but you can choose whichever segment you’re interested in (paid traffic, social traffic, etc.) Or leave it off entirely! Tons of possibilities here.

In fact, here are some additional ideas for blending a source with itself:

  • Compare two-plus custom segments
  • Compare two-plus landing pages
  • Compare two-plus goal completions

18. Create a basic calculated field.

When your existing data doesn’t give you enough information, it’s time to create a calculated field.

Calculated fields take your data and, as their name suggests, makes calculations.

It’s probably easiest to explain with an example.

Let’s say you want to look at the average number of transactions per user. You can create a calculated field that takes the metric “Transactions” and divides it by the metric “Users.”

Once this field has been created, it’ll be updated automatically — so you can change the chart’s time range, dimensions, etc., and the average transactions per user data will update accordingly.

There are two ways to create a calculated field.

Create a data-source calculated field

This option makes the field available in any report that uses that data source.

It’ll also be available as a filter control or in new calculated fields (like calculated field inception).

Obviously, this is a good option if you plan on using this custom metric more than once. The only caveat — you must have edit rights to the original data source. You also can’t use a data source calculated field with blended data.

To create a data-source calculated field, add a chart to your Data Studio dashboard, then choose the data source you want to derive your new field from.

Click “Add a new field” in the lower left-hand corner.

google data studio tips: create new field

(You can also do this by clicking the pencil next to the data source and then selecting “Add a field” in the upper right corner of your field menu.)

google data studio tips: add field button

Use the left menu to search for the metrics you need; click one to add it to the formula.

If the formula has an error, a notification will appear in red underneath the editor explaining where you went wrong.

If your formula works, you’ll get a green checkmark.

google data studio tips: green checkmark

Click “Save” to add your new field to the data source.

And don’t forget to name yours — which I forgot to do. 🙂

Now you can add this calculated field to any chart just like a regular field.

Create a chart-level calculated field

For this option, you’ll only be able to use the field for that specific report.

This option is a little easier because all the limitations of the other type are reversed.

While you can’t use a chart-level calculated field in another chart, filter control, or additional calculated field, you don’t need edit rights to the original data.

You can also use a chart-specific calculated field for data blending, which we’ll cover in the next step.

To create a chart-level calculated field, simply click “Add a field” underneath the existing dimension(s) and metric(s) you’ve selected.

google data studio tips: add dimension and add metricWhen you choose to add a new field, this pane will pop up:

google data studio tips: add new field pane

From here, enter the formula for your new field — simply typing in the name of your desired metric will trigger a menu of options — and click “Apply.”

Your new field will be added to the chart.

Loves Data’s Benjamin Mangold has an excellent round-up of sample calculated metrics, Inklusive:

  • Average goal completions per user
  • Non-bounce rate
  • Pageviews per transaction
  • Value per session

You can check it out for inspiration.

If you want a little practice before you start going to town on your own data, Google offers a handy sample exercise.

19. Create an advanced calculated field.

Okay, so there’s a lot you can do with simple algebraic calculated fields. But there’s even more you can do once you introduce functions and RegEx.

Don’t be scared off! We’ll walk through these step-by-step.

If you’re comfortable with Google Sheets and/or Excel functions, you already know how to use functions in Data Studio.

For instance, let’s say that you majored in English, and it’s always bothered you that “Source” in Google Analytics is lower-case.

You can use the UPPER function to transform Source into all upper-case.

Simply click “Add dimension” > “Create new field.”

google data studio tips: create new fieldThen enter the UPPER formula:

google data studio tips: upper formula

Som Google Sheets expert Ben Collins points out, this trick will also standardize any custom naming; for example, if some people on your team used “chat” for a campaign, and others used “Chat,” the UPPER function will aggregate both together.

Perhaps you want to create a new field for city and country.

Just click “Add dimension” (since city and state are categorical, not quantitative, variables) > “Create field.”

Then use the CONCATENATE function to smush together the City and Country fields.

Screen Shot 2019-05-08 at 5.43.36 PM

Kolla in complete list of functions Data Studio supports.

One of the niftiest is CASE. If you’re unfamiliar, it’s essentially an IF/THEN statement. This function lets you create custom groupings.

For example, let’s say you’re looking at the table we created in the last step:

google data studio tips: table example

Here, Data Studio is treating Facebook mobile traffic (m.facebook.com) and desktop traffic (Facebook) as two different sources. There’s also l.facebook.com — desktop traffic coming via a link shim, which Facebook implemented in 2008 to protect users from potential spam. What if you want to combine all Facebook traffic into a single source?

A CASE formula solves this issue neatly. Here’s the formula:

CASE

WHEN condition THEN result

WHEN condition THEN result

ELSE result

END

You can have one condition (like the example below) or several. The ELSE argument is optional, so feel free to leave it out if you don’t need it.

Here’s the formula we’ll use to group Facebook traffic:

CASE

WHEN REGEXP_MATCH(Source,”^(l.facebook.com|m.facebook.com|facebook.com)$”) THEN “Facebook”

END

This formula tells Data Studio, “If the source matches l.facebook.com, m.facebook.com, or facebook.com, call it ‘Facebook.’”

To add a CASE formula, you must be able to edit the data source.

Click the pencil icon next to your source to bring up the data field editor.

Then click “Add a new field” in the upper right corner.

Enter your formula.

google data studio tips: formula

If the formula works, you’ll see a green checkmark. Give your new field a name and click “Save.” Now you can add this field to any chart or data viz that uses this data source.

You might be thinking, “Okay, great, but was that formula written in Klingon? How do I come up with my own?”

Don’t know RegEx? No problem! This blog post has five formulas to get you started.

20. Create a calculated blended field.

This is the pinnacle of Data Studio mastery, requiring all the skills you’ve already learned and a hefty dose of luck — just kidding, it’s super easy.

Create a blended data source per usual.

In this example, I blended together the GA views for www.hubspot.com and blog.hubspot.com.google data studio tips: blended field

Then click “Add metric” > “Add new field” as you would to create a normal calculated field.

Enter your formula.

I wanted to see “Total Users” (i.e., users from www.hubspot.com plus users from blog.hubspot.com), which is a simple calculation:

google data studio tips: calculation blended field

Notera: It can get a bit hairy here if you’re using two different fields with the same name, as I’m doing here. Sometimes Data Studio is smart enough to recognize the difference, and sometimes it’s not.

If you run into issues, I recommend editing the name of one or both fields in the original data source(s), which you can do at any time by clicking the pencil next to the blended data source.

Then click the pencil next to the field name you want to change.

google data studio tips: editing name of fieldsThis pane will appear; edit the title accordingly.

google data studio tips: editing paneThen click “Save” and go back to your calculated field to update the formula:

google data studio tips: update the formulaDone! I can now see both in my report.

Google Data Studio is the Best Way to Visualize Your Data

Now that you know Data Studio inside and out, you’re well-prepared to create stunning interactive reports for your coworkers, clients, and executives. Use the tips I shared above to make the most of it and successfully show the ROI of your marketing efforts.

Editor’s note: This post was originally published in October 2018 and has been updated for comprehensiveness.

SEO startpaket


Källlänk

Håll ett öga på vad vi gör
Bli först med att få de senaste uppdateringarna och exklusivt innehåll direkt till din e-postinkorg.
Vi lovar att inte spamma dig. Du kan avbryta prenumerationen när som helst.
Ogiltig e-postadress
Klicka för att kommentera

Lämna ett svar

Din e-postadress kommer inte publiceras. Obligatoriska fält är märkta *

MARKNADSFÖRING

5 Steps To Better Brainstorming That Works

Publicerad

5 Steps To Better Brainstorming That Works

Re:Think Innovation author Carla Johnson warns content marketers about brainstorming without doing anything to prime the work.

Omitting the critical preparation step, she says, prevents fresh inspiration. It can also lead to ideas that lack the proper audience focus, don’t align with your content strategy, and fall outside execution capabilities.

To help marketers avoid that trap, Carla developed an approach to generating valuable, viable innovation ideas. She calls it the Perpetual Innovation Process (PIP).

PIP shifts your team from their legacy thought patterns to surface novel ideas and manifests them into actionable marketing. It also builds a path around the pitfalls of traditional brainstorming.

Shift your #content team from legacy thought patterns to surface novel ideas and actionable marketing, says @joderama via @CMIContent. Klicka för att tweeta

Here’s what the process involves and how you can use it to bring more exciting, innovative ideas to market.

Follow the Perpetual Innovation Process

Think of a marketing challenge for which you need an innovative solution. For example, you may struggle to think of a unique theme for a new brand podcast or create an event that advances your thought leadership.

Carla details each step in Re:Think Innovation, but with her permission, I’ve summarized the key points:

Set the stage

You need to know where you hope to arrive. So, before you start the perpetual innovation process, create an objective statement that puts the critical elements into focus.

“Setting an objective creates consensus about the outcome you’re ultimately looking to achieve. It helps you decide what problem you want to solve and how it bubbles up to your goal. It also aligns your team around the work that will need to get done,” Carla says.

Se även  Beyond Title Tags: 5 Worthwhile SEO Tests that Seem “Untestworthy”

Use Carla’s simple template (below) to set that objective. Fill in the blanks to detail why you need ideas, what they’re meant to accomplish for your business, and what constraints you’ll face on the way:

  1. The intention: “We need ideas to ___.”
  2. The impact: “So we can ____.”
  3. The realistic conditions: “With these constraints ____.”

1686012378 589 5 Steps To Better Brainstorming That Works

Establish a brainstorming objective: We need ideas to ____, so we can _____, with these constraints _____ via @CarlaJohnson @joderama @CMIContent. Klicka för att tweeta

Carla says constraints are part of the equation to come up with innovative ideas rather than just creative ones. “Anybody could have an amazing idea if they didn’t have to work within constraints like budget and time,” she says.

Setting real-world boundaries pushes a more disciplined form of thinking. “It provides a more cohesive view of your brand, which can spark opportunities to tell bigger, more impactful stories than the ones you initially envisioned,” Carla says.

Seek inspiration and make purposeful connections

Next, set your objective aside (you’ll return to it later) and work through the five steps in Carla’s innovation framework. In the end, not only will you have a stream of actionable ideas, but you can pitch them to secure stakeholder buy-in:

Step 1: Observe. Pay attention to the world around you, using all your senses. For example, you might see children, a ball, a few squirrels, or some trees if you’re outside. If you close your eyes, you might hear music playing faintly somewhere, smell food cooked on a grill, or feel a warm breeze.

You don’t need to ascribe any meaning to your observations or focus on an objective. Simply be mindful of your surroundings and write each detail you notice.

Se även  Essential Guide to Boss Factory, the Free Saints Row Character Creator

Step 2: Distill. Scrutinize those individual details and discern their meaning in relation to each other. Look for similarities and categorize them into larger groups and patterns. For example, if you group children and a ball, that might bring to mind the idea of play; the sound of music and the smell of the grill could connect to ideas of entertainment or friendship.

Step 3: Relate. See where opportunities might exist to tell a bigger story about your brand. Compare the similarities and differences in the identified patterns and look for ways they might fit into your working world.

Ask yourself: “How might we transplant the ‘essence’ of friendship into our event challenge?” Or, “How might we apply the idea of play to the theme of our podcast?”

Not all patterns will translate but remember: There are no wrong connections, just ones that may not fit your needs. Prioritize the most evident connections to your business for step four.

Step 4: Generate. Solidify those abstract ideas into real possibilities. Take the broad list of how-might-we questions from the previous step and generate as many content ideas as possible for each. Don’t set any limitations. In fact, the wilder and crazier your ideas are, the closer you get to a truly innovative – and executable – idea. Form them as what-if questions, such as “What if we tried to …” or “What if we combine X and Y into …?”

Systematically probe the viability of each one after the ideas stop flowing. Use the constraints from your objective statement to make go or no-go decisions on which to develop. Whittle the go idea list by asking practical questions. For example:

  • Does the idea align with the brand’s priorities?
  • Is it something the audience needs right now?
  • Does the team have the bandwidth and budget to see it through?
  • Will implementation require unavailable capabilities or technologies?
  • Will other functional teams need to get involved?
Se även  Är användardata verkligen skyddad i Google Analytics-universum?

Step 5: Pitch. You’ve already done the hard work by the time you reach this step. Carla refers to the pitch as “the journey of an idea, told in the form of a story.” If you can’t pitch the idea so others will understand and embrace it, you’ll never get it off the ground.

If you can’t pitch an idea so others embrace it, you’ll never get it off the ground, says @CarlaJohnson via @joderama @CMIContent. Klicka för att tweeta

Tell the story of your idea, starting with observe (step one) and working the idea through generate (step four). Present that story through the lens of your audience. Think about what matters to them and how your idea will fit into their world as a cultural product.

Formulate three versions of the pitch – 30 seconds, 90 seconds, and five minutes. Practice delivering each one until you are comfortable enough to deliver them to your stakeholders.

Prepare to conquer your innovation challenges

With a systematic process for generating fresh – and properly focused – ideas, your team can rev up your creative output – and ramp up your ability to add real value to your brand’s experience.

Editor’s note: This article originally appeared in CCO.

Get more advice from Chief Content Officer, a publication for content leaders (monthly starting May 2023). Subscribe today to get it in your inbox.

HANDPLOCKAT RELATERAT INNEHÅLL:

Omslagsbild av Joseph Kalinowski/Content Marketing Institute



Källlänk

Håll ett öga på vad vi gör
Bli först med att få de senaste uppdateringarna och exklusivt innehåll direkt till din e-postinkorg.
Vi lovar att inte spamma dig. Du kan avbryta prenumerationen när som helst.
Ogiltig e-postadress
Fortsätt läsa

MARKNADSFÖRING

Moz Links API: Tryck på varje slutpunkt i Python

Publicerad

Moz Links API: Tryck på varje slutpunkt i Python

The purpose of this Jupyter Notebook is to introduce the Moz Links API using Python. This should work on any notebook hosting environment, such as Google Colab.

If you’re looking at this on Github, the code snippets can be copy/pasted into your own notebook environment. By the time you’ve run this script to the bottom, you will have used every Moz Links API endpoint, and can pick the parts you want for your own project. The official documentation can be found here.

Confused? Be sure to check out my intro to the Moz Links API.

Do global imports

The import statements at the top of a Python program are used to load external resources that are not loaded by default in the Python interpreter. These resources may include libraries or modules that provide additional functionality to the program.

Import statements are usually placed at the top of a program, before any other code is executed. This allows the program to load any necessary resources before they are needed in the program.

Once the resources have been loaded using import statements, they can be used anywhere in the program, not just in the cell where the import statement was written. This allows the program to access the functionality provided by the imported resources throughout its execution.

The libraries here not part of the standard Python library are requests och sqlitedict. You can install the with pip-installationsförfrågningar och pip install sqlitedict in your terminal or a Jupyter cell. If you’re using Anaconda, requests is pre-installed.

import json
import requests
from headlines import *
from pprint import pprint
from sqlitedict import SqliteDict as sqldict

Load login values from external file

The code below reads a file named “linksapi.txt” from the “assets” directory, which contains the login credentials, including the access ID and secret key needed to access the Moz API. These credentials are extracted from the file and assigned to two variables named ACCESSID och SECRETKEY. The with statement is used to ensure that the file is properly closed after it’s been read. Create a file whose contents look like this with your credentials manually retreived from moz.com:

ACCESSID: mozscape-1234567890
SECRETKEY: 1234567890abcdef1234567890abcdef

Once the credentials are extracted from the file, they are stored in a tuple named AUTH_TUPLE. This tuple can be used as an argument to the Moz API functions to authenticate and authorize access to the data.

The purpose of this approach is to avoid hard-coding sensitive login credentials directly in the program, which could pose a security risk if the code was shared or published publicly. Instead, the credentials are kept in a separate file that is not included in the repository, and can be easily created and updated as needed. This way, the code can be shared without exposing the credentials to the public.

with open("../assets/linksapi.txt") as fh:
    ACCESSID, SECRETKEY = [x.strip().split(" ")[1] for x in fh.readlines()]

AUTH_TUPLE = (ACCESSID, SECRETKEY)  # Don't show contents

Configure variables

In this code, there are several configuration variables that are used to set up the API call to the Moz Links API.

The first variable, COMMON_ENDPOINT, is a constant that stores the endpoint URL for the Moz API. The second variable, sub_endpoint, is a string that represents the endpoint subpath for the anchor text data, which will be appended to the COMMON_ENDPOINT URL to form the complete API slutpunkt URL.

The fourth variable, data_dict, is a dictionary that contains the parameters for the API request. In this case, the data_dict specifies the target URL for which we want to retrieve anchor text data, the scope of the data (in this case, page-level), and a limit of 1 result.

Finally, the json_string variable is created by converting the data_dict dictionary into a JSON-formatted string using the json.dumps() function. This string will be used as the request body when making the API call.

These variables are used to configure and parameterize the API request, and can be modified to perform any data_dict request against any Moz Links API sub_endpoint.

COMMON_ENDPOINT = "https://lsapi.seomoz.com/v2/"
sub_endpoint = "anchor_text"
endpoint = COMMON_ENDPOINT + sub_endpoint
data_dict = {"target": "moz.com/blog", "scope": "page", "limit": 1}
json_string = json.dumps(data_dict)

Actually hit the API (ensure success)

In JupyterLab, the last line of a code cell is automatically printed to the output area without requiring an explicit print() statement. The code you provided is using the requests module to send a POST request to a URL url with data in the form of a JSON string json_string. The authentication details are passed using the AUTH_TUPLE variable.

After sending the request, the response object r is printed using the print() statement. This will print the HTTP status code, such as 200 for success, 404 for not found, etc., along with the response headers.

Finally, the .json() method is called on the response object svar to parse the response data as JSON and return it as a Python dictionary. This dictionary can be assigned to a variable, used for further processing, or simply printed to the output area without requiring an explicit print() statement due to JupyterLab’s automatic printing behavior for the last line of a code cell.

response = requests.post(endpoint, data=json_string, auth=AUTH_TUPLE)
pprint(response.json())

Outputs:

{'next_token': 'JYkQVg4s9ak8iRBWDiz1qTyguYswnj035nqjRF0IbW96IGJsb2e58hGzcmSomw==',
 'results': [{'anchor_text': 'moz',
              'external_pages': 7183,
              'external_root_domains': 2038}]}

List Sub-endpoints

This code defines a list of different sub-endpoints that can be appended to a common URL prefix to make different API endpoints. An API endpoint is a URL where an API can be accessed by clients. It is a point of entry to the application that acts as a gatekeeper between the client and the server. Each endpoint is identified by a unique URL, which can be used to interact with the API.

In this code, the list of sub-endpoints is defined in the sub_endpoints variable, and each endpoint is represented as a string. The for loop iterates over the list, prints the index number and name of each sub-endpoint using the print function, and increments the index by 1. The enumerate function is used to generate a sequence of pairs consisting of an index and a value from the list.

This code is useful for exploring the available endpoints for a particular API and for selecting the endpoint that corresponds to the desired functionality. By changing the sub-endpoint in the URL, clients can access different resources or perform different operations on the server.

sub_endpoints = [
    "anchor_text",
    "final_redirect",
    "global_top_pages",
    "global_top_root_domains",
    "index_metadata",
    "link_intersect",
    "link_status",
    "linking_root_domains",
    "links",
    "top_pages",
    "url_metrics",
    "usage_data",
]
for i, sub_endpoint in enumerate(sub_endpoints):
    print(i + 1, sub_endpoint)

Outputs:

1 anchor_text
2 final_redirect
3 global_top_pages
4 global_top_root_domains
5 index_metadata
6 link_intersect
7 link_status
8 linking_root_domains
9 links
10 top_pages
11 url_metrics
12 usage_data

Human-friendly labels

This code defines two lists: names och descriptions. The names list contains human-friendly labels for the set of sub-endpoints, while the descriptions list provides a brief description of each endpoint. The two lists are kept in the same order as the points list defined earlier in the code.

By keeping the three lists in the same order, they can be “zipped” together into a single list of tuples using the zip function. This produces a new list where each tuple contains the name, endpoint, and description for a particular API endpoint. This makes it easy to display a user-friendly summary of each API endpoint with its name and description.

De zip function combines the elements of the three lists element-wise, creating a tuple of the first elements from each list, then a tuple of the second elements, and so on. The resulting list of tuples can be iterated over, and each tuple unpacked to access the individual name, endpoint, and description elements for each API endpoint.

names = [
    "Anchor Text",
    "Final Redirect",
    "Global Top Pages",
    "Global Top Root Domains",
    "Index Metadata",
    "Link Intersect",
    "Link Status",
    "Linking Root Domains",
    "Links",
    "Top Pages",
    "URL Metrics",
    "Usage Data",
]

descriptions = [
    "Use this endpoint to get data about anchor text used by followed external links to a target. Results are ordered by external_root_domains descending.",
    "Use this endpoint to get data about anchor text used by followed external links to a target. Results are ordered by external_root_domains descending.",
    "This endpoint returns the top 500 pages in the entire index with the highest Page Authority values, sorted by Page Authority. (Visit the Top 500 Sites list to explore the top root domains on the web, sorted by Domain Authority.)",
    "This endpoint returns the top 500 pages in the entire index with the highest Page Authority values, sorted by Page Authority. (Visit the Top 500 Sites list to explore the top root domains on the web, sorted by Domain Authority.)",
    "This endpoint returns the top 500 pages in the entire index with the highest Page Authority values, sorted by Page Authority. (Visit the Top 500 Sites list to explore the top root domains on the web, sorted by Domain Authority.)",
    "Use this endpoint to get sources that link to at least one of a list of positive targets and don't link to any of a list of negative targets.",
    "Use this endpoint to get information about links from many sources to a single target.",
    "Use this endpoint to get linking root domains to a target.",
    "Use this endpoint to get links to a target.",
    "This endpoint returns top pages on a target domain.",
    "Use this endpoint to get metrics about one or more urls.",
    "This endpoint Returns the number of rows consumed so far in the current billing period. The count returned might not reflect rows consumed in the last hour. The count returned reflects rows consumed by requests to both the v1 (Moz Links API) and v2 Links APIs.",
]

# Simple zipping example
list(zip(names, sub_endpoints, descriptions))

Outputs:

[('Anchor Text',
  'anchor_text',
  'Use this endpoint to get data about anchor text used by followed external links to a target. Results are ordered by external_root_domains descending.'),
 ('Final Redirect',
  'final_redirect',
  'Use this endpoint to get data about anchor text used by followed external links to a target. Results are ordered by external_root_domains descending.'),
 ('Global Top Pages',
  'global_top_pages',
  'This endpoint returns the top 500 pages in the entire index with the highest Page Authority values, sorted by Page Authority. (Visit the Top 500 Sites list to explore the top root domains on the web, sorted by Domain Authority.)'),
 ('Global Top Root Domains',
  'global_top_root_domains',
  'This endpoint returns the top 500 pages in the entire index with the highest Page Authority values, sorted by Page Authority. (Visit the Top 500 Sites list to explore the top root domains on the web, sorted by Domain Authority.)'),
 ('Index Metadata',
  'index_metadata',
  'This endpoint returns the top 500 pages in the entire index with the highest Page Authority values, sorted by Page Authority. (Visit the Top 500 Sites list to explore the top root domains on the web, sorted by Domain Authority.)'),
 ('Link Intersect',
  'link_intersect',
  "Use this endpoint to get sources that link to at least one of a list of positive targets and don't link to any of a list of negative targets."),
 ('Link Status',
  'link_status',
  'Use this endpoint to get information about links from many sources to a single target.'),
 ('Linking Root Domains',
  'linking_root_domains',
  'Use this endpoint to get linking root domains to a target.'),
 ('Links', 'links', 'Use this endpoint to get links to a target.'),
 ('Top Pages',
  'top_pages',
  'This endpoint returns top pages on a target domain.'),
 ('URL Metrics',
  'url_metrics',
  'Use this endpoint to get metrics about one or more urls.'),
 ('Usage Data',
  'usage_data',
  'This endpoint Returns the number of rows consumed so far in the current billing period. The count returned might not reflect rows consumed in the last hour. The count returned reflects rows consumed by requests to both the v1 (Moz Links API) and v2 Links APIs.')]

Show an example request for each endpoint

This is a list of API requests in Python dict format, where each dictionary represents a request to a specific endpoint. Don’t hurt your brain too much trying to read it. Just know that I lifted each example from the original Moz documentation and listed them all here in order as nested Python dicts.

Se även  32 of the Best Office Pranks & Practical Jokes to Use at Work

You could call the format is a dict of dicts, where each sub-dictionary corresponds to a specific endpoint, same order as the sub_endpoints, names, och descriptions lists for easy combining. The output of running the below cell is doing that list-combining to document every sub_endpoint.

dict_of_dicts = {
    "anchor_text": {"target": "moz.com/blog", "scope": "page", "limit": 5},
    "links": {
        "target": "moz.com/blog",
        "target_scope": "page",
        "filter": "external+nofollow",
        "limit": 1,
    },
    "final_redirect": {"page": "seomoz.org/blog"},
    "global_top_pages": {"limit": 5},
    "global_top_root_domains": {"limit": 5},
    "index_metadata": {},
    "link_intersect": {
        "positive_targets": [
            {"target": "latimes.com", "scope": "root_domain"},
            {"target": "blog.nytimes.com", "scope": "subdomain"},
        ],
        "negative_targets": [{"target": "moz.com", "scope": "root_domain"}],
        "source_scope": "page",
        "sort": "source_domain_authority",
        "limit": 1,
    },
    "link_status": {
        "target": "moz.com/blog",
        "sources": ["twitter.com", "linkedin.com"],
        "source_scope": "root_domain",
        "target_scope": "page",
    },
    "linking_root_domains": {
        "target": "moz.com/blog",
        "target_scope": "page",
        "filter": "external",
        "sort": "source_domain_authority",
        "limit": 5,
    },
    "top_pages": {"target": "moz.com", "scope": "root_domain", "limit": 5},
    "url_metrics": {"targets": ["moz.com", "nytimes.com"]},
    "usage_data": {},
}

for i, sub_endpoint in enumerate(sub_endpoints):
    h1(f"{i + 1}. {names[i]} ({sub_endpoint})")
    print(descriptions[i])
    h4("Example request:")
    pprint(dict_of_dicts[sub_endpoint])
    print()

Outputs:

# 2. Final Redirect (final_redirect)

Use this endpoint to get data about anchor text used by followed external links to a target. Results are ordered by external_root_domains descending.
Example request:

{'page': 'seomoz.org/blog'}

[...]

Write a function that hits the API

If we’re going to hit an API over and over in mostly the same way, we want to spare ourselves re-typing everything all the time. That’s why we define functions. That’s the def in the below cell. Once that cell is run, the moz() function can be used anywhere in this Notebook. You need only feed it the sub_endpoint you want to use and a Python dict of your request. It will return the API’s response.

def moz(sub_endpoint, data_dict):
    """Hits Moz Links API with specified endpoint and request and returns results."""
    json_string = json.dumps(data_dict)
    endpoint = COMMON_ENDPOINT + sub_endpoint
    # Below, data is a string (flattened JSON) but auth is a 2-position tuple.
    response = requests.post(endpoint, data=json_string, auth=AUTH_TUPLE)
    return response

This does not output anything to the screen. It just defines the function.

Conditionally hit the API

The code uses a Python package calledb which provides a persistent dictionary-like object that can be stored on disk using the SQLite database engine. The with statement in the code sets up a context manager for the SqliteDict object, which automatically handles opening and closing the database connection. The database file is stored at ../dbs/linksapi.db

The code iterates through each sub-endpoint in the sub_endpoints list, and checks if that data has already been retrieved. If it hasn’t, the API is called using the moz() function and the result is saved in the SqliteDict. The db.commit() statement ensures that any changes made to the dictionary during the iteration are saved to the database.

Se även  Google driver uppdatering för att åtgärda några problematiska webbplatsnamn i sökningen

The SqliteDict serves as a local cache to prevent the API from being hit every time the code block is run if the data has already been collected. By using this cache, the code reduces the number of API requests required, which is useful when working with APIs that have quota limits. Congratulations, you’re using a database!

with sqldict("../dbs/linksapi.db") as db:
    for sub_endpoint in sub_endpoints:
        if sub_endpoint not in db:
            print(sub_endpoint)
            result = moz(sub_endpoint, dict_of_dicts[sub_endpoint])
            db[sub_endpoint] = result
            db.commit()
            print("API hit and response saved!")
            print()
h2("Done")

This does not output anything to the screen. It saves the results of the API-calls to a local database.

Show the locally-stored API responses

This code uses the sqldict context manager to open the SQLite database containing the previously retrieved API data. It then iterates over the keys in the database, which correspond to the endpoints that were previously retrieved.

For each key, the code prints the endpoint name, description, and the data retrieved from the API. The pprint function is used to print the JSON data in a more human-readable format, with indentation and line breaks that make it easier to read.

with sqldict("../dbs/linksapi.db") as db:
    for i, key in enumerate(db):
        h1(f"{i + 1}. {names[i]} ({key})")
        print(descriptions[i])
        print()
        pprint(db[key].json())
        print()

Outputs:

1. Anchor Text (anchor_text)
Use this endpoint to get data about anchor text used by followed external links to a target. Results are ordered by external_root_domains descending.

{'next_token': 'KIkQVg4s9ak8iRBWDiz1qTyguYswnj035n7bYI0Lc2VvbW96IGJsb2dKBcCodcl47Q==',
 'results': [{'anchor_text': 'moz',
              'external_pages': 7162,
              'external_root_domains': 2026},
             {'anchor_text': 'moz blog',
              'external_pages': 15525,
              'external_root_domains': 1364},
             {'anchor_text': 'the moz blog',
              'external_pages': 7879,
              'external_root_domains': 728},
             {'anchor_text': 'seomoz',
              'external_pages': 17741,
              'external_root_domains': 654},
             {'anchor_text': 'https://moz.com/blog',
              'external_pages': 978,
              'external_root_domains': 491}]}

2. Final Redirect (final_redirect)
Use this endpoint to get data about anchor text used by followed external links to a target. Results are ordered by external_root_domains descending.

{'page': 'moz.com/blog'}

3. Global Top Pages (global_top_pages)
This endpoint returns the top 500 pages in the entire index with the highest Page Authority values, sorted by Page Authority. (Visit the Top 500 Sites list to explore the top root domains on the web, sorted by Domain Authority.)

{'next_token': 'BcLbRwBmrXHK',
 'results': [{'deleted_pages_to_page': 11932076,
              'deleted_pages_to_root_domain': 23942663640,
              'deleted_pages_to_subdomain': 21555752652,
              'deleted_root_domains_to_page': 64700,
              'deleted_root_domains_to_root_domain': 3688228,
              'deleted_root_domains_to_subdomain': 3516235,
              'domain_authority': 96,
              'external_indirect_pages_to_root_domain': 5042652519,
              'external_nofollow_pages_to_page': 31163,
              'external_nofollow_pages_to_root_domain': 12375460748,
              'external_nofollow_pages_to_subdomain': 11393036086,
              'external_pages_to_page': 118102549,
              'external_pages_to_root_domain': 91362310623,
              'external_pages_to_subdomain': 83283626903,
              'external_redirect_pages_to_page': 0,
              'external_redirect_pages_to_root_domain': 445730476,
              'external_redirect_pages_to_subdomain': 432323198,
              'http_code': 5,
              'indirect_root_domains_to_page': 0,
              'indirect_root_domains_to_root_domain': 701121,
              'last_crawled': '2023-01-15',
              'link_propensity': 1.76710455e-05,
              'nofollow_pages_from_page': 0,
              'nofollow_pages_from_root_domain': 2,
              'nofollow_pages_to_page': 31163,
              'nofollow_pages_to_root_domain': 12375623717,
              'nofollow_pages_to_subdomain': 11393036179,
              'nofollow_root_domains_from_page': 0,
              'nofollow_root_domains_from_root_domain': 0,
              'nofollow_root_domains_to_page': 980,
              'nofollow_root_domains_to_root_domain': 3696150,
              'nofollow_root_domains_to_subdomain': 3622349,
              'page': 'www.facebook.com/Plesk',
              'page_authority': 100,
              'pages_crawled_from_root_domain': 1810872,
              'pages_from_page': 0,
              'pages_from_root_domain': 5289,
              'pages_to_page': 118102549,
              'pages_to_root_domain': 91368257043,
              'pages_to_subdomain': 83288001442,
              'redirect_pages_to_page': 0,
              'redirect_pages_to_root_domain': 447189164,
              'redirect_pages_to_subdomain': 433411292,
              'root_domain': 'facebook.com',
              'root_domains_from_page': 0,
              'root_domains_from_root_domain': 32,
              'root_domains_to_page': 491956,
              'root_domains_to_root_domain': 59416650,
              'root_domains_to_subdomain': 50993087,
              'spam_score': 1,
              'subdomain': 'www.facebook.com',
              'title': ''},
             {'deleted_pages_to_page': 5828966,
              'deleted_pages_to_root_domain': 79909678,
              'deleted_pages_to_subdomain': 79909678,
              'deleted_root_domains_to_page': 16552,
              'deleted_root_domains_to_root_domain': 98416,
              'deleted_root_domains_to_subdomain': 98416,
              'domain_authority': 94,
              'external_indirect_pages_to_root_domain': 1177381629,
              'external_nofollow_pages_to_page': 453328699,
              'external_nofollow_pages_to_root_domain': 1643990147,
              'external_nofollow_pages_to_subdomain': 1643990147,
              'external_pages_to_page': 456279611,
              'external_pages_to_root_domain': 2808523112,
              'external_pages_to_subdomain': 2808523112,
              'external_redirect_pages_to_page': 125,
              'external_redirect_pages_to_root_domain': 24941546,
              'external_redirect_pages_to_subdomain': 24941546,
              'http_code': 3,
              'indirect_root_domains_to_page': 723,
              'indirect_root_domains_to_root_domain': 252606,
              'last_crawled': '2023-01-14',
              'link_propensity': 0.118001014,
              'nofollow_pages_from_page': 0,
              'nofollow_pages_from_root_domain': 121166,
              'nofollow_pages_to_page': 453328699,
              'nofollow_pages_to_root_domain': 1644293277,
              'nofollow_pages_to_subdomain': 1644293277,
              'nofollow_root_domains_from_page': 0,
              'nofollow_root_domains_from_root_domain': 67627,
              'nofollow_root_domains_to_page': 9800973,
              'nofollow_root_domains_to_root_domain': 4959747,
              'nofollow_root_domains_to_subdomain': 4959747,
              'page': 'wordpress.com/?ref=footer_blog',
              'page_authority': 100,
              'pages_crawled_from_root_domain': 1731019,
              'pages_from_page': 0,
              'pages_from_root_domain': 1080338,
              'pages_to_page': 456293004,
              'pages_to_root_domain': 2817137385,
              'pages_to_subdomain': 2817137385,
              'redirect_pages_to_page': 125,
              'redirect_pages_to_root_domain': 25449067,
              'redirect_pages_to_subdomain': 25449067,
              'root_domain': 'wordpress.com',
              'root_domains_from_page': 0,
              'root_domains_from_root_domain': 204262,
              'root_domains_to_page': 9878742,
              'root_domains_to_root_domain': 12653294,
              'root_domains_to_subdomain': 12653294,
              'spam_score': 1,
              'subdomain': 'wordpress.com',
              'title': ''},
             {'deleted_pages_to_page': 3904778,
              'deleted_pages_to_root_domain': 23942663640,
              'deleted_pages_to_subdomain': 21555752652,
              'deleted_root_domains_to_page': 11671,
              'deleted_root_domains_to_root_domain': 3688228,
              'deleted_root_domains_to_subdomain': 3516235,
              'domain_authority': 96,
              'external_indirect_pages_to_root_domain': 5042652519,
              'external_nofollow_pages_to_page': 4449343,
              'external_nofollow_pages_to_root_domain': 12375460748,
              'external_nofollow_pages_to_subdomain': 11393036086,
              'external_pages_to_page': 59602588,
              'external_pages_to_root_domain': 91362310623,
              'external_pages_to_subdomain': 83283626903,
              'external_redirect_pages_to_page': 12625,
              'external_redirect_pages_to_root_domain': 445730476,
              'external_redirect_pages_to_subdomain': 432323198,
              'http_code': 5,
              'indirect_root_domains_to_page': 1632,
              'indirect_root_domains_to_root_domain': 701121,
              'last_crawled': '2023-01-16',
              'link_propensity': 1.76710455e-05,
              'nofollow_pages_from_page': 0,
              'nofollow_pages_from_root_domain': 2,
              'nofollow_pages_to_page': 4449343,
              'nofollow_pages_to_root_domain': 12375623717,
              'nofollow_pages_to_subdomain': 11393036179,
              'nofollow_root_domains_from_page': 0,
              'nofollow_root_domains_from_root_domain': 0,
              'nofollow_root_domains_to_page': 28624,
              'nofollow_root_domains_to_root_domain': 3696150,
              'nofollow_root_domains_to_subdomain': 3622349,
              'page': 'www.facebook.com/home.php',
              'page_authority': 100,
              'pages_crawled_from_root_domain': 1810872,
              'pages_from_page': 0,
              'pages_from_root_domain': 5289,
              'pages_to_page': 59602589,
              'pages_to_root_domain': 91368257043,
              'pages_to_subdomain': 83288001442,
              'redirect_pages_to_page': 12626,
              'redirect_pages_to_root_domain': 447189164,
              'redirect_pages_to_subdomain': 433411292,
              'root_domain': 'facebook.com',
              'root_domains_from_page': 0,
              'root_domains_from_root_domain': 32,
              'root_domains_to_page': 239697,
              'root_domains_to_root_domain': 59416650,
              'root_domains_to_subdomain': 50993087,
              'spam_score': 1,
              'subdomain': 'www.facebook.com',
              'title': ''},
             {'deleted_pages_to_page': 3440567,
              'deleted_pages_to_root_domain': 3440700,
              'deleted_pages_to_subdomain': 3440700,
              'deleted_root_domains_to_page': 60839,
              'deleted_root_domains_to_root_domain': 60840,
              'deleted_root_domains_to_subdomain': 60840,
              'domain_authority': 1,
              'external_indirect_pages_to_root_domain': 7,
              'external_nofollow_pages_to_page': 288,
              'external_nofollow_pages_to_root_domain': 1499,
              'external_nofollow_pages_to_subdomain': 1499,
              'external_pages_to_page': 140954613,
              'external_pages_to_root_domain': 140959216,
              'external_pages_to_subdomain': 140959213,
              'external_redirect_pages_to_page': 70,
              'external_redirect_pages_to_root_domain': 70,
              'external_redirect_pages_to_subdomain': 70,
              'http_code': 200,
              'indirect_root_domains_to_page': 0,
              'indirect_root_domains_to_root_domain': 0,
              'last_crawled': '2018-02-05',
              'link_propensity': 0.3998428881,
              'nofollow_pages_from_page': 12,
              'nofollow_pages_from_root_domain': 805,
              'nofollow_pages_to_page': 288,
              'nofollow_pages_to_root_domain': 10799,
              'nofollow_pages_to_subdomain': 10799,
              'nofollow_root_domains_from_page': 2,
              'nofollow_root_domains_from_root_domain': 7,
              'nofollow_root_domains_to_page': 30,
              'nofollow_root_domains_to_root_domain': 30,
              'nofollow_root_domains_to_subdomain': 30,
              'page': 'music.skyrock.com/',
              'page_authority': 100,
              'pages_crawled_from_root_domain': 2546,
              'pages_from_page': 61,
              'pages_from_root_domain': 3382,
              'pages_to_page': 140956009,
              'pages_to_root_domain': 141008586,
              'pages_to_subdomain': 141008583,
              'redirect_pages_to_page': 70,
              'redirect_pages_to_root_domain': 70,
              'redirect_pages_to_subdomain': 70,
              'root_domain': 'music.skyrock.com',
              'root_domains_from_page': 19,
              'root_domains_from_root_domain': 1018,
              'root_domains_to_page': 10609865,
              'root_domains_to_root_domain': 10609868,
              'root_domains_to_subdomain': 10609868,
              'spam_score': 9,
              'subdomain': 'music.skyrock.com',
              'title': 'Blog de Music - DES NEWS, DES CLIPS, DES INTERVIEWS - '
                       'Skyrock.com'},
             {'deleted_pages_to_page': 64159924,
              'deleted_pages_to_root_domain': 17641375891,
              'deleted_pages_to_subdomain': 336246205,
              'deleted_root_domains_to_page': 63574,
              'deleted_root_domains_to_root_domain': 1728606,
              'deleted_root_domains_to_subdomain': 234073,
              'domain_authority': 100,
              'external_indirect_pages_to_root_domain': 19281720347,
              'external_nofollow_pages_to_page': 34635431,
              'external_nofollow_pages_to_root_domain': 7885369442,
              'external_nofollow_pages_to_subdomain': 184067821,
              'external_pages_to_page': 285612569,
              'external_pages_to_root_domain': 55013651418,
              'external_pages_to_subdomain': 1492976347,
              'external_redirect_pages_to_page': 593282,
              'external_redirect_pages_to_root_domain': 250423075,
              'external_redirect_pages_to_subdomain': 5678006,
              'http_code': 302,
              'indirect_root_domains_to_page': 1072,
              'indirect_root_domains_to_root_domain': 231256,
              'last_crawled': '2023-04-01',
              'link_propensity': 0.006248265505,
              'nofollow_pages_from_page': 0,
              'nofollow_pages_from_root_domain': 991472,
              'nofollow_pages_to_page': 34635436,
              'nofollow_pages_to_root_domain': 7948674425,
              'nofollow_pages_to_subdomain': 184068512,
              'nofollow_root_domains_from_page': 0,
              'nofollow_root_domains_from_root_domain': 182393,
              'nofollow_root_domains_to_page': 126656,
              'nofollow_root_domains_to_root_domain': 2322389,
              'nofollow_root_domains_to_subdomain': 304381,
              'page': 'youtube.com/',
              'page_authority': 100,
              'pages_crawled_from_root_domain': 41258009,
              'pages_from_page': 0,
              'pages_from_root_domain': 11109186,
              'pages_to_page': 285612606,
              'pages_to_root_domain': 55255620288,
              'pages_to_subdomain': 1493073570,
              'redirect_pages_to_page': 593282,
              'redirect_pages_to_root_domain': 263224806,
              'redirect_pages_to_subdomain': 5678383,
              'root_domain': 'youtube.com',
              'root_domains_from_page': 0,
              'root_domains_from_root_domain': 257791,
              'root_domains_to_page': 598403,
              'root_domains_to_root_domain': 23134271,
              'root_domains_to_subdomain': 1927717,
              'spam_score': 4,
              'subdomain': 'youtube.com',
              'title': ''}]}

4. Global Top Root Domains (global_top_root_domains)
This endpoint returns the top 500 pages in the entire index with the highest Page Authority values, sorted by Page Authority. (Visit the Top 500 Sites list to explore the top root domains on the web, sorted by Domain Authority.)

{'next_token': 'BcLbRwBmrXHK',
 'results': [{'domain_authority': 100,
              'link_propensity': 0.006248265505,
              'root_domain': 'youtube.com',
              'root_domains_to_root_domain': 23134271,
              'spam_score': 4,
              'to_target': {'deleted_pages': 0,
                            'nofollow_pages': 0,
                            'pages': 0,
                            'redirect_pages': 0}},
             {'domain_authority': 100,
              'link_propensity': 0.008422264829,
              'root_domain': 'www.google.com',
              'root_domains_to_root_domain': 14723695,
              'spam_score': 14,
              'to_target': {'deleted_pages': 0,
                            'nofollow_pages': 0,
                            'pages': 0,
                            'redirect_pages': 0}},
             {'domain_authority': 100,
              'link_propensity': 0.0001607139566,
              'root_domain': 'www.blogger.com',
              'root_domains_to_root_domain': 30580427,
              'spam_score': -1,
              'to_target': {'deleted_pages': 0,
                            'nofollow_pages': 0,
                            'pages': 0,
                            'redirect_pages': 0}},
             {'domain_authority': 99,
              'link_propensity': 0.04834850505,
              'root_domain': 'linkedin.com',
              'root_domains_to_root_domain': 12339087,
              'spam_score': 1,
              'to_target': {'deleted_pages': 0,
                            'nofollow_pages': 0,
                            'pages': 0,
                            'redirect_pages': 0}},
             {'domain_authority': 99,
              'link_propensity': 0.006264935713,
              'root_domain': 'microsoft.com',
              'root_domains_to_root_domain': 5344181,
              'spam_score': 11,
              'to_target': {'deleted_pages': 0,
                            'nofollow_pages': 0,
                            'pages': 0,
                            'redirect_pages': 0}}]}

5. Index Metadata (index_metadata)
This endpoint returns the top 500 pages in the entire index with the highest Page Authority values, sorted by Page Authority. (Visit the Top 500 Sites list to explore the top root domains on the web, sorted by Domain Authority.)

{'index_id': 'NE+lX5bFh06baS9ojUwVbw==',
 'spam_score_update_days': ['2019-02-08',
                            '2020-03-28',
                            '2020-08-03',
                            '2020-11-13',
                            '2021-02-24',
                            '2021-05-19',
                            '2021-08-16',
                            '2021-11-02',
                            '2022-02-01',
                            '2022-05-10',
                            '2022-11-16']}

6. Link Intersect (link_intersect)
Use this endpoint to get sources that link to at least one of a list of positive targets and don't link to any of a list of negative targets.

{'next_token': 'AcmY2oCXQbbg',
 'results': [{'domain_authority': 100,
              'matching_target_indexes': [0],
              'page': 'www.google.com/amp/www.latimes.com/local/lanow/la-me-ln-aliso-viejo-shooting-20171012-story,amp.html',
              'spam_score': 14,
              'title': ''}]}

7. Link Status (link_status)
Use this endpoint to get information about links from many sources to a single target.

{'exists': [False, False]}

8. Linking Root Domains (linking_root_domains)
Use this endpoint to get linking root domains to a target.

{'next_token': 'IokQVg4s9ak8iRBWDiz1qTyguYswnj035qBkmE3DU+JTtwAVhsjH7R6XUA==',
 'results': [{'domain_authority': 99,
              'link_propensity': 0.006264935713,
              'root_domain': 'microsoft.com',
              'root_domains_to_root_domain': 5344181,
              'spam_score': 11,
              'to_target': {'deleted_pages': 0,
                            'nofollow_pages': 0,
                            'pages': 2,
                            'redirect_pages': 0}},
             {'domain_authority': 98,
              'link_propensity': 0.02977741137,
              'root_domain': 'wordpress.org',
              'root_domains_to_root_domain': 12250296,
              'spam_score': 2,
              'to_target': {'deleted_pages': 0,
                            'nofollow_pages': 2,
                            'pages': 2,
                            'redirect_pages': 0}},
             {'domain_authority': 96,
              'link_propensity': 0.09679271281,
              'root_domain': 'github.com',
              'root_domains_to_root_domain': 2948013,
              'spam_score': 2,
              'to_target': {'deleted_pages': 0,
                            'nofollow_pages': 12,
                            'pages': 12,
                            'redirect_pages': 0}},
             {'domain_authority': 96,
              'link_propensity': 0.004641198553,
              'root_domain': 'amazon.com',
              'root_domains_to_root_domain': 5023132,
              'spam_score': 28,
              'to_target': {'deleted_pages': 0,
                            'nofollow_pages': 0,
                            'pages': 2,
                            'redirect_pages': 0}},
             {'domain_authority': 95,
              'link_propensity': 0.005770479795,
              'root_domain': 'shopify.com',
              'root_domains_to_root_domain': 2948087,
              'spam_score': 1,
              'to_target': {'deleted_pages': 3,
                            'nofollow_pages': 0,
                            'pages': 0,
                            'redirect_pages': 0}}]}

9. Links (links)
Use this endpoint to get links to a target.

{'next_token': 'AVvpJ4gPPvOY',
 'results': [{'anchor_text': 'moz blog',
              'date_disappeared': '',
              'date_first_seen': '2020-06-29',
              'date_last_seen': '2023-01-14',
              'nofollow': True,
              'redirect': False,
              'rel_canonical': False,
              'source': {'deleted_pages_to_page': 570,
                         'deleted_pages_to_root_domain': 1251501128,
                         'deleted_pages_to_subdomain': 1182759912,
                         'deleted_root_domains_to_page': 34,
                         'deleted_root_domains_to_root_domain': 322790,
                         'deleted_root_domains_to_subdomain': 314554,
                         'domain_authority': 96,
                         'external_indirect_pages_to_root_domain': 863103308,
                         'external_nofollow_pages_to_page': 1407,
                         'external_nofollow_pages_to_root_domain': 667480081,
                         'external_nofollow_pages_to_subdomain': 650421076,
                         'external_pages_to_page': 3710,
                         'external_pages_to_root_domain': 5309615021,
                         'external_pages_to_subdomain': 5086141938,
                         'external_redirect_pages_to_page': 14,
                         'external_redirect_pages_to_root_domain': 143685025,
                         'external_redirect_pages_to_subdomain': 142061138,
                         'http_code': 200,
                         'indirect_root_domains_to_page': 2,
                         'indirect_root_domains_to_root_domain': 180014,
                         'last_crawled': '2023-01-14',
                         'link_propensity': 0.09679271281,
                         'nofollow_pages_from_page': 199,
                         'nofollow_pages_from_root_domain': 7541042,
                         'nofollow_pages_to_page': 1407,
                         'nofollow_pages_to_root_domain': 678014273,
                         'nofollow_pages_to_subdomain': 660443683,
                         'nofollow_root_domains_from_page': 93,
                         'nofollow_root_domains_from_root_domain': 564314,
                         'nofollow_root_domains_to_page': 58,
                         'nofollow_root_domains_to_root_domain': 186407,
                         'nofollow_root_domains_to_subdomain': 171632,
                         'page': 'github.com/mezod/awesome-indie',
                         'page_authority': 68,
                         'pages_crawled_from_root_domain': 7254823,
                         'pages_from_page': 202,
                         'pages_from_root_domain': 8613796,
                         'pages_to_page': 3746,
                         'pages_to_root_domain': 5628821927,
                         'pages_to_subdomain': 5352019489,
                         'redirect_pages_to_page': 14,
                         'redirect_pages_to_root_domain': 145613441,
                         'redirect_pages_to_subdomain': 142856036,
                         'root_domain': 'github.com',
                         'root_domains_from_page': 96,
                         'root_domains_from_root_domain': 702214,
                         'root_domains_to_page': 231,
                         'root_domains_to_root_domain': 2948013,
                         'root_domains_to_subdomain': 2857538,
                         'spam_score': 2,
                         'subdomain': 'github.com',
                         'title': 'GitHub - mezod/awesome-indie: Resources for '
                                  'independent developers to make money'},
              'target': {'deleted_pages_to_page': 169073,
                         'deleted_pages_to_root_domain': 19022927,
                         'deleted_pages_to_subdomain': 18554702,
                         'deleted_root_domains_to_page': 1457,
                         'deleted_root_domains_to_root_domain': 27522,
                         'deleted_root_domains_to_subdomain': 27273,
                         'domain_authority': 91,
                         'external_indirect_pages_to_root_domain': 45290099,
                         'external_nofollow_pages_to_page': 7388,
                         'external_nofollow_pages_to_root_domain': 17425478,
                         'external_nofollow_pages_to_subdomain': 17269297,
                         'external_pages_to_page': 553261,
                         'external_pages_to_root_domain': 69376449,
                         'external_pages_to_subdomain': 68746190,
                         'external_redirect_pages_to_page': 265,
                         'external_redirect_pages_to_root_domain': 41112725,
                         'external_redirect_pages_to_subdomain': 41109338,
                         'http_code': 200,
                         'indirect_root_domains_to_page': 2219,
                         'indirect_root_domains_to_root_domain': 28779,
                         'last_crawled': '2023-04-02',
                         'link_propensity': 0.008849279955,
                         'nofollow_pages_from_page': 0,
                         'nofollow_pages_from_root_domain': 209067,
                         'nofollow_pages_to_page': 7388,
                         'nofollow_pages_to_root_domain': 17442464,
                         'nofollow_pages_to_subdomain': 17285191,
                         'nofollow_root_domains_from_page': 0,
                         'nofollow_root_domains_from_root_domain': 55943,
                         'nofollow_root_domains_to_page': 1727,
                         'nofollow_root_domains_to_root_domain': 37789,
                         'nofollow_root_domains_to_subdomain': 37690,
                         'page': 'moz.com/blog',
                         'page_authority': 69,
                         'pages_crawled_from_root_domain': 7872618,
                         'pages_from_page': 7,
                         'pages_from_root_domain': 343751,
                         'pages_to_page': 906052,
                         'pages_to_root_domain': 98442581,
                         'pages_to_subdomain': 97352802,
                         'redirect_pages_to_page': 746,
                         'redirect_pages_to_root_domain': 47575576,
                         'redirect_pages_to_subdomain': 47570092,
                         'root_domain': 'moz.com',
                         'root_domains_from_page': 5,
                         'root_domains_from_root_domain': 69667,
                         'root_domains_to_page': 9712,
                         'root_domains_to_root_domain': 179884,
                         'root_domains_to_subdomain': 178649,
                         'spam_score': 1,
                         'subdomain': 'moz.com',
                         'title': 'The Moz Blog [SEO] - Moz'},
              'via_redirect': False,
              'via_rel_canonical': False}]}

10. Top Pages (top_pages)
This endpoint returns top pages on a target domain.

{'next_token': 'BXULGXd3IggK',
 'results': [{'deleted_pages_to_page': 1963527,
              'deleted_pages_to_root_domain': 19022927,
              'deleted_pages_to_subdomain': 18554702,
              'deleted_root_domains_to_page': 6527,
              'deleted_root_domains_to_root_domain': 27522,
              'deleted_root_domains_to_subdomain': 27273,
              'domain_authority': 91,
              'external_indirect_pages_to_root_domain': 45290099,
              'external_nofollow_pages_to_page': 9684724,
              'external_nofollow_pages_to_root_domain': 17425478,
              'external_nofollow_pages_to_subdomain': 17269297,
              'external_pages_to_page': 14981546,
              'external_pages_to_root_domain': 69376449,
              'external_pages_to_subdomain': 68746190,
              'external_redirect_pages_to_page': 3632556,
              'external_redirect_pages_to_root_domain': 41112725,
              'external_redirect_pages_to_subdomain': 41109338,
              'http_code': 200,
              'indirect_root_domains_to_page': 10580,
              'indirect_root_domains_to_root_domain': 28779,
              'last_crawled': '2023-04-01',
              'link_propensity': 0.008849279955,
              'nofollow_pages_from_page': 0,
              'nofollow_pages_from_root_domain': 209067,
              'nofollow_pages_to_page': 9684724,
              'nofollow_pages_to_root_domain': 17442464,
              'nofollow_pages_to_subdomain': 17285191,
              'nofollow_root_domains_from_page': 0,
              'nofollow_root_domains_from_root_domain': 55943,
              'nofollow_root_domains_to_page': 8749,
              'nofollow_root_domains_to_root_domain': 37789,
              'nofollow_root_domains_to_subdomain': 37690,
              'page': 'moz.com/',
              'page_authority': 74,
              'pages_crawled_from_root_domain': 7872618,
              'pages_from_page': 7,
              'pages_from_root_domain': 343751,
              'pages_to_page': 15343034,
              'pages_to_root_domain': 98442581,
              'pages_to_subdomain': 97352802,
              'redirect_pages_to_page': 3633007,
              'redirect_pages_to_root_domain': 47575576,
              'redirect_pages_to_subdomain': 47570092,
              'root_domain': 'moz.com',
              'root_domains_from_page': 5,
              'root_domains_from_root_domain': 69667,
              'root_domains_to_page': 41190,
              'root_domains_to_root_domain': 179884,
              'root_domains_to_subdomain': 178649,
              'spam_score': 1,
              'subdomain': 'moz.com',
              'title': 'Moz - SEO Software for Smarter Marketing'},
             {'deleted_pages_to_page': 185579,
              'deleted_pages_to_root_domain': 19022927,
              'deleted_pages_to_subdomain': 18554702,
              'deleted_root_domains_to_page': 2440,
              'deleted_root_domains_to_root_domain': 27522,
              'deleted_root_domains_to_subdomain': 27273,
              'domain_authority': 91,
              'external_indirect_pages_to_root_domain': 45290099,
              'external_nofollow_pages_to_page': 11211,
              'external_nofollow_pages_to_root_domain': 17425478,
              'external_nofollow_pages_to_subdomain': 17269297,
              'external_pages_to_page': 424268,
              'external_pages_to_root_domain': 69376449,
              'external_pages_to_subdomain': 68746190,
              'external_redirect_pages_to_page': 348,
              'external_redirect_pages_to_root_domain': 41112725,
              'external_redirect_pages_to_subdomain': 41109338,
              'http_code': 200,
              'indirect_root_domains_to_page': 1389,
              'indirect_root_domains_to_root_domain': 28779,
              'last_crawled': '2023-04-03',
              'link_propensity': 0.008849279955,
              'nofollow_pages_from_page': 0,
              'nofollow_pages_from_root_domain': 209067,
              'nofollow_pages_to_page': 11211,
              'nofollow_pages_to_root_domain': 17442464,
              'nofollow_pages_to_subdomain': 17285191,
              'nofollow_root_domains_from_page': 0,
              'nofollow_root_domains_from_root_domain': 55943,
              'nofollow_root_domains_to_page': 2487,
              'nofollow_root_domains_to_root_domain': 37789,
              'nofollow_root_domains_to_subdomain': 37690,
              'page': 'moz.com/beginners-guide-to-seo',
              'page_authority': 72,
              'pages_crawled_from_root_domain': 7872618,
              'pages_from_page': 7,
              'pages_from_root_domain': 343751,
              'pages_to_page': 786960,
              'pages_to_root_domain': 98442581,
              'pages_to_subdomain': 97352802,
              'redirect_pages_to_page': 365,
              'redirect_pages_to_root_domain': 47575576,
              'redirect_pages_to_subdomain': 47570092,
              'root_domain': 'moz.com',
              'root_domains_from_page': 5,
              'root_domains_from_root_domain': 69667,
              'root_domains_to_page': 15276,
              'root_domains_to_root_domain': 179884,
              'root_domains_to_subdomain': 178649,
              'spam_score': 1,
              'subdomain': 'moz.com',
              'title': "Beginner's Guide to SEO [plus FREE quick start "
                       'checklist] - Moz'},
             {'deleted_pages_to_page': 7159,
              'deleted_pages_to_root_domain': 19022927,
              'deleted_pages_to_subdomain': 18554702,
              'deleted_root_domains_to_page': 1382,
              'deleted_root_domains_to_root_domain': 27522,
              'deleted_root_domains_to_subdomain': 27273,
              'domain_authority': 91,
              'external_indirect_pages_to_root_domain': 45290099,
              'external_nofollow_pages_to_page': 8605,
              'external_nofollow_pages_to_root_domain': 17425478,
              'external_nofollow_pages_to_subdomain': 17269297,
              'external_pages_to_page': 34152,
              'external_pages_to_root_domain': 69376449,
              'external_pages_to_subdomain': 68746190,
              'external_redirect_pages_to_page': 70,
              'external_redirect_pages_to_root_domain': 41112725,
              'external_redirect_pages_to_subdomain': 41109338,
              'http_code': 200,
              'indirect_root_domains_to_page': 782,
              'indirect_root_domains_to_root_domain': 28779,
              'last_crawled': '2023-04-03',
              'link_propensity': 0.008849279955,
              'nofollow_pages_from_page': 0,
              'nofollow_pages_from_root_domain': 209067,
              'nofollow_pages_to_page': 8754,
              'nofollow_pages_to_root_domain': 17442464,
              'nofollow_pages_to_subdomain': 17285191,
              'nofollow_root_domains_from_page': 0,
              'nofollow_root_domains_from_root_domain': 55943,
              'nofollow_root_domains_to_page': 1380,
              'nofollow_root_domains_to_root_domain': 37789,
              'nofollow_root_domains_to_subdomain': 37690,
              'page': 'moz.com/google-algorithm-change',
              'page_authority': 70,
              'pages_crawled_from_root_domain': 7872618,
              'pages_from_page': 420,
              'pages_from_root_domain': 343751,
              'pages_to_page': 35181,
              'pages_to_root_domain': 98442581,
              'pages_to_subdomain': 97352802,
              'redirect_pages_to_page': 73,
              'redirect_pages_to_root_domain': 47575576,
              'redirect_pages_to_subdomain': 47570092,
              'root_domain': 'moz.com',
              'root_domains_from_page': 60,
              'root_domains_from_root_domain': 69667,
              'root_domains_to_page': 8881,
              'root_domains_to_root_domain': 179884,
              'root_domains_to_subdomain': 178649,
              'spam_score': 1,
              'subdomain': 'moz.com',
              'title': 'Moz - Google Algorithm Update History'},
             {'deleted_pages_to_page': 33133,
              'deleted_pages_to_root_domain': 19022927,
              'deleted_pages_to_subdomain': 18554702,
              'deleted_root_domains_to_page': 1192,
              'deleted_root_domains_to_root_domain': 27522,
              'deleted_root_domains_to_subdomain': 27273,
              'domain_authority': 91,
              'external_indirect_pages_to_root_domain': 45290099,
              'external_nofollow_pages_to_page': 31500,
              'external_nofollow_pages_to_root_domain': 17425478,
              'external_nofollow_pages_to_subdomain': 17269297,
              'external_pages_to_page': 70673,
              'external_pages_to_root_domain': 69376449,
              'external_pages_to_subdomain': 68746190,
              'external_redirect_pages_to_page': 77,
              'external_redirect_pages_to_root_domain': 41112725,
              'external_redirect_pages_to_subdomain': 41109338,
              'http_code': 301,
              'indirect_root_domains_to_page': 315,
              'indirect_root_domains_to_root_domain': 28779,
              'last_crawled': '2023-04-02',
              'link_propensity': 0.008849279955,
              'nofollow_pages_from_page': 0,
              'nofollow_pages_from_root_domain': 209067,
              'nofollow_pages_to_page': 31628,
              'nofollow_pages_to_root_domain': 17442464,
              'nofollow_pages_to_subdomain': 17285191,
              'nofollow_root_domains_from_page': 0,
              'nofollow_root_domains_from_root_domain': 55943,
              'nofollow_root_domains_to_page': 1689,
              'nofollow_root_domains_to_root_domain': 37789,
              'nofollow_root_domains_to_subdomain': 37690,
              'page': 'moz.com/researchtools/ose/',
              'page_authority': 70,
              'pages_crawled_from_root_domain': 7872618,
              'pages_from_page': 0,
              'pages_from_root_domain': 343751,
              'pages_to_page': 344305,
              'pages_to_root_domain': 98442581,
              'pages_to_subdomain': 97352802,
              'redirect_pages_to_page': 78,
              'redirect_pages_to_root_domain': 47575576,
              'redirect_pages_to_subdomain': 47570092,
              'root_domain': 'moz.com',
              'root_domains_from_page': 0,
              'root_domains_from_root_domain': 69667,
              'root_domains_to_page': 8086,
              'root_domains_to_root_domain': 179884,
              'root_domains_to_subdomain': 178649,
              'spam_score': 1,
              'subdomain': 'moz.com',
              'title': ''},
             {'deleted_pages_to_page': 169073,
              'deleted_pages_to_root_domain': 19022927,
              'deleted_pages_to_subdomain': 18554702,
              'deleted_root_domains_to_page': 1457,
              'deleted_root_domains_to_root_domain': 27522,
              'deleted_root_domains_to_subdomain': 27273,
              'domain_authority': 91,
              'external_indirect_pages_to_root_domain': 45290099,
              'external_nofollow_pages_to_page': 7388,
              'external_nofollow_pages_to_root_domain': 17425478,
              'external_nofollow_pages_to_subdomain': 17269297,
              'external_pages_to_page': 553261,
              'external_pages_to_root_domain': 69376449,
              'external_pages_to_subdomain': 68746190,
              'external_redirect_pages_to_page': 265,
              'external_redirect_pages_to_root_domain': 41112725,
              'external_redirect_pages_to_subdomain': 41109338,
              'http_code': 200,
              'indirect_root_domains_to_page': 2219,
              'indirect_root_domains_to_root_domain': 28779,
              'last_crawled': '2023-04-02',
              'link_propensity': 0.008849279955,
              'nofollow_pages_from_page': 0,
              'nofollow_pages_from_root_domain': 209067,
              'nofollow_pages_to_page': 7388,
              'nofollow_pages_to_root_domain': 17442464,
              'nofollow_pages_to_subdomain': 17285191,
              'nofollow_root_domains_from_page': 0,
              'nofollow_root_domains_from_root_domain': 55943,
              'nofollow_root_domains_to_page': 1727,
              'nofollow_root_domains_to_root_domain': 37789,
              'nofollow_root_domains_to_subdomain': 37690,
              'page': 'moz.com/blog',
              'page_authority': 69,
              'pages_crawled_from_root_domain': 7872618,
              'pages_from_page': 7,
              'pages_from_root_domain': 343751,
              'pages_to_page': 906052,
              'pages_to_root_domain': 98442581,
              'pages_to_subdomain': 97352802,
              'redirect_pages_to_page': 746,
              'redirect_pages_to_root_domain': 47575576,
              'redirect_pages_to_subdomain': 47570092,
              'root_domain': 'moz.com',
              'root_domains_from_page': 5,
              'root_domains_from_root_domain': 69667,
              'root_domains_to_page': 9712,
              'root_domains_to_root_domain': 179884,
              'root_domains_to_subdomain': 178649,
              'spam_score': 1,
              'subdomain': 'moz.com',
              'title': 'The Moz Blog [SEO] - Moz'}]}

11. URL Metrics (url_metrics)
Use this endpoint to get metrics about one or more urls.

{'results': [{'deleted_pages_to_page': 1963527,
              'deleted_pages_to_root_domain': 19022927,
              'deleted_pages_to_subdomain': 18554702,
              'deleted_root_domains_to_page': 6527,
              'deleted_root_domains_to_root_domain': 27522,
              'deleted_root_domains_to_subdomain': 27273,
              'domain_authority': 91,
              'external_indirect_pages_to_root_domain': 45290099,
              'external_nofollow_pages_to_page': 9684724,
              'external_nofollow_pages_to_root_domain': 17425478,
              'external_nofollow_pages_to_subdomain': 17269297,
              'external_pages_to_page': 14981546,
              'external_pages_to_root_domain': 69376449,
              'external_pages_to_subdomain': 68746190,
              'external_redirect_pages_to_page': 3632556,
              'external_redirect_pages_to_root_domain': 41112725,
              'external_redirect_pages_to_subdomain': 41109338,
              'http_code': 200,
              'indirect_root_domains_to_page': 10580,
              'indirect_root_domains_to_root_domain': 28779,
              'last_crawled': '2023-04-01',
              'link_propensity': 0.008849279955,
              'nofollow_pages_from_page': 0,
              'nofollow_pages_from_root_domain': 209067,
              'nofollow_pages_to_page': 9684724,
              'nofollow_pages_to_root_domain': 17442464,
              'nofollow_pages_to_subdomain': 17285191,
              'nofollow_root_domains_from_page': 0,
              'nofollow_root_domains_from_root_domain': 55943,
              'nofollow_root_domains_to_page': 8749,
              'nofollow_root_domains_to_root_domain': 37789,
              'nofollow_root_domains_to_subdomain': 37690,
              'page': 'moz.com/',
              'page_authority': 74,
              'pages_crawled_from_root_domain': 7872618,
              'pages_from_page': 7,
              'pages_from_root_domain': 343751,
              'pages_to_page': 15343034,
              'pages_to_root_domain': 98442581,
              'pages_to_subdomain': 97352802,
              'redirect_pages_to_page': 3633007,
              'redirect_pages_to_root_domain': 47575576,
              'redirect_pages_to_subdomain': 47570092,
              'root_domain': 'moz.com',
              'root_domains_from_page': 5,
              'root_domains_from_root_domain': 69667,
              'root_domains_to_page': 41190,
              'root_domains_to_root_domain': 179884,
              'root_domains_to_subdomain': 178649,
              'spam_score': 1,
              'subdomain': 'moz.com',
              'title': 'Moz - SEO Software for Smarter Marketing'},
             {'deleted_pages_to_page': 249094,
              'deleted_pages_to_root_domain': 224212706,
              'deleted_pages_to_subdomain': 898844,
              'deleted_root_domains_to_page': 3696,
              'deleted_root_domains_to_root_domain': 177001,
              'deleted_root_domains_to_subdomain': 9251,
              'domain_authority': 95,
              'external_indirect_pages_to_root_domain': 156562794,
              'external_nofollow_pages_to_page': 163849,
              'external_nofollow_pages_to_root_domain': 72093550,
              'external_nofollow_pages_to_subdomain': 294697,
              'external_pages_to_page': 1165187,
              'external_pages_to_root_domain': 514661963,
              'external_pages_to_subdomain': 2310818,
              'external_redirect_pages_to_page': 3049,
              'external_redirect_pages_to_root_domain': 4827448,
              'external_redirect_pages_to_subdomain': 8140,
              'http_code': 301,
              'indirect_root_domains_to_page': 1439,
              'indirect_root_domains_to_root_domain': 30315,
              'last_crawled': '2023-03-31',
              'link_propensity': 0.02704063244,
              'nofollow_pages_from_page': 0,
              'nofollow_pages_from_root_domain': 97163,
              'nofollow_pages_to_page': 163881,
              'nofollow_pages_to_root_domain': 72644206,
              'nofollow_pages_to_subdomain': 294765,
              'nofollow_root_domains_from_page': 0,
              'nofollow_root_domains_from_root_domain': 22711,
              'nofollow_root_domains_to_page': 5647,
              'nofollow_root_domains_to_root_domain': 178651,
              'nofollow_root_domains_to_subdomain': 11590,
              'page': 'nytimes.com/',
              'page_authority': 82,
              'pages_crawled_from_root_domain': 13567138,
              'pages_from_page': 0,
              'pages_from_root_domain': 3152122,
              'pages_to_page': 1170498,
              'pages_to_root_domain': 763781494,
              'pages_to_subdomain': 2489707,
              'redirect_pages_to_page': 3053,
              'redirect_pages_to_root_domain': 9268395,
              'redirect_pages_to_subdomain': 14273,
              'root_domain': 'nytimes.com',
              'root_domains_from_page': 0,
              'root_domains_from_root_domain': 366864,
              'root_domains_to_page': 25307,
              'root_domains_to_root_domain': 2200598,
              'root_domains_to_subdomain': 62699,
              'spam_score': 1,
              'subdomain': 'nytimes.com',
              'title': ''}]}

12. Usage Data (usage_data)
This endpoint Returns the number of rows consumed so far in the current billing period. The count returned might not reflect rows consumed in the last hour. The count returned reflects rows consumed by requests to both the v1 (Moz Links API) and v2 Links APIs.

{'rows_consumed': 254}



Källlänk

Se även  5 Things to Keep in Mind Before Choosing a Web Research Outsourcing Partner
Håll ett öga på vad vi gör
Bli först med att få de senaste uppdateringarna och exklusivt innehåll direkt till din e-postinkorg.
Vi lovar att inte spamma dig. Du kan avbryta prenumerationen när som helst.
Ogiltig e-postadress
Fortsätt läsa

MARKNADSFÖRING

12 AI-verktyg som hjälper dig att växa din blogg

Publicerad

12 AI-verktyg som hjälper dig att växa din blogg

OK, you get it. Artificial intelligence is kind of a big deal. It’s a huge buzzword in the marketing community, with people talking daily about how it’ll change the world. And you can’t throw a rock without hitting a company with AI in the name these days.

Gratis guide: Hur man använder AI i innehållsmarknadsföring [Ladda ner nu]
(mer …)

Se även  How To Launch Your First Google Ads Remarketing Campaign
Håll ett öga på vad vi gör
Bli först med att få de senaste uppdateringarna och exklusivt innehåll direkt till din e-postinkorg.
Vi lovar att inte spamma dig. Du kan avbryta prenumerationen när som helst.
Ogiltig e-postadress
Fortsätt läsa

Trendigt

sv_SESvenska