Integrating the Publica script in your website or blog

This page explains how to integrate the Publica script into your website.

You will only need to integrate this script once.

Step 1: Copy the Publica Script associated with your Team


You can retrieve your Publica script in two places:

  1. When signing up, at the "Set Up" stage simply copy the script to your clipboard.
  2. After signing up, navigate to "Settings > Script Management

Step 2: Paste the snippet before the </head> tag of your page

If you are implementing the Publica script into your website

Your head tag can be found at the very beginning of your HTML document as shown in the example below:

<!DOCTYPE html>
<html>
  <head lang="en">
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <title>Your Website</title>
    ...
	INSERT CODE HERE
  </head>
  <body>
  ...
  </body>
</html>

We recommend not commenting the Publica script to avoid easy detection by ad blockers



If you are implementing into the Publica Script into Blogger

  1. Blogger requires the script to be HTML encoded before being added to the source code of your blog. To do so, follow these steps

    1. Paste the script in your text editor
    2. Select all of the content inside the <script> ... </script> tags
    3. Copy/Paste it in an HTML Encoder provider (e.g., http://www.opinionatedgeek.com/dotnet/tools/htmlencode/encode.aspx)
    4. Copy the encoded HTML
    5. In your text editor replace the content of the Publica script inside the <script> ...</script> tags
    6. Your new script should look like this

      <script>
      	YOUR HTML-ENCODED FUNCTION HERE
      </script>
  2. Log in to blogger.com

  3. Navigate to the "Template" page

3. Select "Edit HTML"

4. Paste the Publica script before the </head> tag

We recommend not commenting the Publica script to avoid easy detection by ad blockers


If you are using Wordpress

First, there is a difference if you are using Wordpress.com, the fully hosted version or Wordpress.org, the self-hosted version. Unfortunately, Wordpress.com does not allow users to edit source codes & templates.  If you are wondering how to monetize on video ads on Wordpress, you can check FAQs.

If you are using Wordpress.org, you can use the Publica ad recovery plugin or implement the scrip manually:

A) Via the Publica Ad Recovery WordPress Plugin:

  1. Please install and activate the Worpress Plugin. 
  2. Create an account on getpublica.com if you have not created one already.
  3. Once you are on the “Set Up” stage, no need to copy/ paste the snippet in the header of your site. Please skip this step and return to WordPress.
     
  4. In your wordpress settings, you should find a new option called Publica Ad Recovery. Click on it and log in with your Publica credentials.
  5. Access your analytics dashboard on the Publica User Interface
  6. You are all set!

B)  Manual Implementation

  1. Log into your account and access your Wordpress dashboard. (ex: http://www.example.com/wp-admin/index.php)
  2. Select Plugins / Add new
  3. Scroll down and select Theme Header (header.php) on the right hand side.
  4. Scroll down and paste the Publica script just before "</head>"
  5. Scroll down once again and click on update files button.
  6. You are all set!

Using a support we haven't listed, let us know: contact@getpublica.com


© 2022 Publica LLC ®, All Rights Reserved.
76 Roosevelt Circle • Palo Alto, CA 94306 USA
Contact Us  •   Terms of Use   •   Privacy Policy