Skip to content

Latest commit

 

History

History
executable file
·
191 lines (126 loc) · 7.36 KB

File metadata and controls

executable file
·
191 lines (126 loc) · 7.36 KB

Index

This socument show how to implement tag on WordPress using plugin.

Step 1 : Install “Advertising Manager” which is WordPress plugin

1)Install "Advertising Manager"

General ways are as followings;

A)How to search the plugin on UI and install

  • On the UI of WordPress, you can see the section named “Plugins>Add new” on the left side, then click on that section and Search for ”advertising-manager”
  • Might find out ”Advertising Manager” by Scott Switzer
  • Click “now install” button then the installation finished.

インストール方法その1

B)How to select the plugin zip file and install

  • Download the plugin zip file from WordPress plugin「Advertising Manager」
  • On the UI of WordPress, you can see the section named ”Appearance>Edit” on the left side then, click on that section and select “Upload plugin”.
  • Select the zip file, click button “Install now”

C)How to upload plugin directly on server

  • • Download the plugin zip file from WordPressplug-in「Advertising Manager」.
  • Upload the zip file on the “wp-contents/plugins” directory “wp-contents/plugins” which is installed via Wordpress
  • Extract the zip file

2)Activate ”Advertising Manager”

On the UI of WordPress, you can see the section named ”Plugins>Installed plugins” on the left side then click on that section and activate “Advertising Manager”.

有効化

Step 2: Set up “Advertising Manager”

1) Edit theme

Add the code where you would like to make new ad spot by editing the theme.

Ex) After installation, many templates are shown on feed list at the initial stage. In this case, there are 3 templates as per belowl。

  • Main index template (index.php)
  • Search template (search.php)
  • Archive template (archive.php)

テンプレート

Add code on template

  • On the UI of WordPress, you can see the section named”Appearance>Edit” on the left side then click on that section and select the template that you would like to edit(index.phporsearch.phparchive.php etc...)
  • Add 2 code per details below
    • Add the following code on the line just before the end of the loop
      • advman_ad('ADVS_xxx-' . (is_null($advs_xxx) ? ($advs_xxx = 1) : ++$advs_xxx));
        • xxx : Set optional name depend on contents. Ex)index page => ADVS_index
        • Can use Alphanumeric only for xxx
    • Add following code on the line after loop termination
      • advman_ad('ADVS_xxx');
  • Press “Update File” button then finish to edit editing template

Sample:Adding the code on index template

	// Start the Loop.
	while ( have_posts() ) : the_post();

		/*
		 * Include the Post-Format-specific template for the content.
		 * If you want to override this in a child theme, then include a file
		 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
		 */
		get_template_part( 'content', get_post_format() );

		advman_ad('ADVS_index-' . (is_null($advs_index) ? ($advs_index = 1) : ++$advs_index));	// ←Add this code.

	// End the loop.
	endwhile;
	advman_ad('ADVS_index');													// ←Add this code.

テンプレートの編集

2) Ad spot setting on “Advertising Manager”

Set ad template and ad call script

Create tag for template

Create tag for template. It is necessary to make different templates on each media. Please refer here for the access of further details.

Sample: Tag for template

<div class="article">
	<div class="icon">
		<a href="{{click_url}}"><img src="{{main_image_url}}"></a>
	</div>
	<div class="contents">
		<h3>{{title}}</h3>
		<p>{{description}}</p>
		<span class="source">Sponsored</span>
	</div>
</div>

Please refer here to know which placeholders you can use.

Draft ad template tag and ad call script

On the UI of WordPress, you can see the section named “plug in(Ads>Create new)” on the left side then click on that section and paste the following code then and import.

<script type="text/advs-instream-template" data-adspot-id="ad spot ID">
<!-- Paste the template that make in above section -->
</script>
<script src="//js.mtburn.com/advs-instream.js"></script>
<script>MTBADVS.InStream.Default.run();</script>

広告設定1

  • Paste the template in above section on the area “Paste the template that make in above section”. When you would like to assign number of text, need to set in this point. Please refer here to know more detail.
  • Set ad spot ID that registered on admin UI on ad spot ID. 広告枠ID

After import, move"Edit Settings for HTML Ad"

  • Change HTML to ADVS_xxx
  • Fill in “1” on the box ” Account Details > Max Ads Per Page”
  • Click “save” button and the registration completed.

広告設定2

Set up the tag which assign ad placement

On the UI of WordPress, you can see the section named “plug in(Ads>Create new)” on the left side then click on that section and paste the following code then and import.

<div data-advs-adspot-id="ad spot ID" style="display:none"></div>

広告設定2

-Enter the ID that registered on admin UI on ad spot ID which is the same ID with ad template’s.。

After import, move"Edit Settings for HTML Ad"。

  • Change HTML to ADVS_xxx-<ad display position>
    • Change xxx to previous input name. The current sample name is ADVS_index.
    • Enter only the integer on <ad display position>. Note that the ads will be automatically displayed in the next below section
  • Click “save” button and the registration completed

広告設定2

In case you would like to create more ad spots, please repeat the same instructions and procedures Set up the tag which assign ad placement again.

Setting is completed.

Check if infeed ad displayed on template section.