Getting started - Initial setup of templates and Publishers
- Create one or more "Document templates", based on what you need to use for your Publishers. It can be based on things like languages or what you would like to show in the Invoice to the Publishers (we will cover Macros and details later on, no worries ). You add this in Global Settings -> Document templates. We will go through this step in detail below, as it is the largest and most complex step by far. Please notice that if you get stuck, just reach out to our support team.
- Set invoicing email addresses for all the Publishers you would like to send the invoice statements to and fill in other options if necessary. This is set up under each Publisher in the Publisher Accounts:
Setting up the Publisher account invoice info:
- Invoice Email – The recipient(s) of the invoices. You can use semicolons to specify multiple email addresses.
- Language – Notice that document templates for the language must be set up in Global invoice settings (see below). Otherwise, the documents can’t be generated for the publisher.
Optional settings:
- Minimum invoice EUR – Overrides the setting for this particular publisher in the Global invoice settings.
- Invoice Statement Template – Overrides the default Invoice template for the publisher.
- Balance Info Template – Overrides the default Info letter template for the publisher.
Setting up the Document templates:
The document templates are the templates used to generate invoices. Basically, they are HTML documents that can contain macros - like {{invoiceEUR}} that are replaced with the invoice sum when the document/invoice is generated. There are also more advanced “macros” available that can handle lists and conditions, etc (for showing the list of revenue by segment for example). This is done by a 3’rd party library and the syntax is documented here: https://handlebarsjs.com
We will always help you with this during the Onboarding phase, but feel free to contact the support if this turns out to be complex - we know it is!
You can find the Document Templates in the Admin:
This is how the document template looks when you start editing it or creating a new one:
Options:
- Type – Type of template, for Invoicing statements + Info letters – always select Invoice template.
- Subject – Mail subject, notice that you can use the macros here just as in the actual document.
Insert macro in content – Here you can choose among the available macros and it will be inserted on the cursor position in the document below (doesn’t work in Source mode where HTML is edited directly).
Using data tables in the document templates.
When creating tables in the documents (currently the list of segments/sites with revenue) - there is, unfortunately, no good way to insert the necessary {{#each}} and {{#if}} macros directly using the editor in the normal “WYSIWYG” mode.
Instead, we have to edit the HTML directly by pressing the Source button in the top left corner.
In the example below we want to show one table row (<tr> element) for each segment, so what we want to do (that will not work, continue reading...) is this:
Doesn't work:
However, unfortunately, the HTML editor will remove all text we put in-between table rows. Because of this, we need to use a “hack”. If you create an HTML element with an attribute named macro, then this element will be replaced by only the content inside the macro attribute:
The above code will work and the “extra” <tr> elements with the macro attribute will not be part of the generated document.
Creating report tables and links in the document
What kind of report(s) should be included as tables and links in the documents is not always obvious - should it be per site and or segment, just per date, and should it be a table or chart or both, etc, etc... Therefore it’s possible to dynamically create tables and links to different report types that can be included.
Report tables
Notice: included tables currently only support one level, so you can’t for example group by Site and then Segment. For report links, there is no such limitation.
Go to: Reports > New report (or choose existing) > Select a report type > Adjust report settings > Other options > "Copy as invoice table
Example: We’ll create a table that shows an Ad Revenue Insights report by revenue type (Deals, direct, or OpenRTB), the amount of revenue reserved for your Publisher, and how many impressions you have sold for them:
Then press the Other options and the COPY AS INVOICE TABLE button in order to copy the desired report table to the clipboard. Notice that the Start date and End date will change dynamically to the invoice period and that Filter by => Publishers will automatically get the value of the publisher (so these settings won’t be copied and you don’t need to care about them)
Now we can paste the table as a new table – or into an existing table – in the document template, and it will look something like this:
As you can see the content looks somewhat strange, but what you need to know is this:
- The first and last row below the header (starting with [Macro start] and [Macro end]) won’t be part of the generated document. But if you copy the rows into another table – make sure to include all three rows below the header, as start + end rows are needed.
- The middle row is the “template” for all rows that will appear depending on the report result. You can apply styling (like making the text bold) on all cells on that middle row including the first one which will be the label (like a site name or a revenue type, etc). Just make sure you select all text in the cell when you apply styling, including the surrounding and rel64EncStart / rel64EncStop- texts.
- You can change the order of the columns if you like - for example, if you want Publisher revenue before Total revenue, etc. Do that in the middle “template” row,
Fixing the border style
As you might notice if you paste the table as a new table, the default styling of the table uses these “double lines”. Unfortunately, there isn't any easy way to fix that in the editor, so you need to manually add CSS styling like the below if you don't want to use it:
- Right-click on the table and select Table Properties
- Select the Advanced Tab
- in the Style, textbox append the following text (don’t remove the existing text if there is any): border-collapse:collapse;
Press OK, the border should now have a more modern single-line design.
Important! Check that the table is not too wide for a PDF
Please check that the width of the table is not more than ~750px to make sure that it fits into the PDF version of the invoice. You can preview a non-generated invoice for this purpose. If it is too wide you can either use the mouse to shrink the columns/table and/or you can change Width from the Table Properties right-click the menu,
Report links
Report links can now easily be created by clicking COPY AS INVOICE LINK under Other options in the Report settings; just next to the COPY AS INVOICE TABLE. Then simply paste it into the document template (the text will default to the report’s title).
Getting started - Global invoice settings
The Edit global settings in the Invoices statement workspace page takes you to the following dialogue:
For each language we want to send invoices in we must select the corresponding document templates (the language will be the one selected for the publisher, initially all are set to English). If you don’t know how to create a new document template you can relax - as we’ll cover that later in this document...
- Minimum Invoice (EUR) – This is the limit to when actual invoice statements should be sent instead of short info notices.
- Invoice Mail CC address – Each invoice sent will be CC’ed to this address(es). Use semicolons to separate if there should be multiple addresses.
Edit revenue corrections in the Invoice statement view
As invoices for the SSPs and Adservers are coming in we need to update the total revenue we’ve received. The differences between these numbers and the report numbers will be used as corrections in subsequent invoices (this is also covered in the "Monthly procedure").
So for each SSP and Adserver and month, you have the option to enter a manual number, this should be the total number of revenue received for that month from that system (so not the month the money was received)
You also have the option to add additional costs, if you would have any. If no publishers are selected under Limit to certain publishers – then all publishers will share the cost. The correction per publisher will be proportional to the publisher's revenue.
Extra correction per invoice
To add extra corrections for an individual invoice you can click the Extra corrections on the edit page of the invoice after you have generated the first version. Please notice that the Edit option will not be available until after you have generated the invoice, so first generate the invoice, and then press the Edit button:
You will then have the option to add extra corrections to each invoice:
Please notice that the corrections will not be applied until you re-generate the invoice! Do that by using the Re-generate Invoice button at the bottom of the Edit page. Depending on how your document template is set up the formatting of the added extra correction line might differ.
Monthly procedure suggestion:
Every month, when you want to create your invoice statements, you might want to add corrections as well. The corrections are basically the difference between the API data in the SSPs, and the actual money the SSPs are going to pay you, based on their own Invoice statement.
Please always use the CHECK REPORT REVENUE button to see if there is a large discrepancy (> ~3%) between the number you’re about to enter and the reported revenue. In that case, it might be a good idea to let the Relevant Yield support team know about it in order to make a further investigation. If everything looks ok, proceed to:
- Correct monthly revenues from SSPs as this money comes in. This can be done at any point before/after generating the invoices. This will create “corrections” on subsequently generated invoices.
- Add other monthly corrections (If needed!). Notice that this step must be performed every month.
- Generate, review, and send the Invoice Statements + info notices.
What does everything mean in the workspace?:
The above page is accessible via the INVOICES top bar menu. The Invoices will have any of the following Statuses:
- Non-generated – This invoice is not generated yet, but will show the content of the invoice once generated.
- Ready – An invoice that has been generated but not yet sent. This is the only status where editing the invoice is possible. As generating an invoice makes its’ content “fixed” (e.g. it won’t change if the publisher’s report data is adjusted) - one should not keep invoices Ready unnecessarily long time before sending them.
- Sent – The invoice statement has been sent but we have not yet paid the publisher.
- Settled – We’ve received an invoice back and paid the money.
The Types can be the following:
- Invoice – An invoice statement.
- Info – An info letter sent to Audience publishers that have not yet reached the minimum cumulative sum for an invoice. (limit is configurable on global+publisher level and can potentially also be used for Programmatic)
The Actions that can be performed on each Invoice depend on the Status, e.g. only a Ready invoice can be Sent. If you select several invoices with the checkboxes - the actions you perform using the action buttons above the list will only apply to the matching invoices.