How To Install Optizen

You are here:
< All Topics

Installing the Optizen app requires some changes to your theme code. Please make sure you duplicate (backup) your store theme prior to installing. If you don’t know how to do this, you can see a tutorial here:

https://help.shopify.com/en/manual/online-store/os/using-themes/managing-themes/duplicating-themes

Done For You Installation:

We also offer an installation service if you are not comfortable with editing your theme files. If you would like to use this service, please submit a support ticket here of our developers will get back to you.

This service is free for paid app subscriptions.

Manually Install Yourself

IMPORTANT NOTE FOR BOTH FREE & PRO USERS:

If you have Optizen Version 1 installed (collection content only), you will need to first remove the existing line of code.

Navigate to collection.liquid in Templates

Cntrl + F and search for:

<div class="col_lower_main" style="width:100%"><div class="inner_lower_main" style="max-width:1170px;margin:0 auto;">{{ collection.metafields.collectionlower.lowerdata }}</div></div>

Delete this line of code and SAVE. Then complete the installation below.

FREE VERSION:

Files That Require Editing:

– collection.liquid /All Collection Template

1) collection.liquid – In Templates

Add the following code at the bottom of the collection.liquid file.

<!-- Optizen V2 -->
{% assign con_tent ='' %} {% if collection.metafields.collectionlower.show_content == 'all_pages' %} {% assign con_tent = collection.metafields.collectionlower.lowerdata %} {% else %} {% if current_page == 1 %} {% assign con_tent = collection.metafields.collectionlower.lowerdata %} {% endif %} {% endif %} <div class='col_lower_main' style='width:100%'> <div class='inner_lower_main' style='max-width:1170px;margin:0 auto;'> {{ con_tent }} </div> </div>
<!-- End Optizen V2 -->

Save the file.

PRO VERSION

Files That Require Editing:

– theme.liquid

– collection.liquid /All Collection Templates

– collection-template.liquid

– social-meta-tags.liquid

1) theme.liquid – In Layout

Add the below code inside the <head>

<!-- Optizen V2 -->
{% if template contains 'collection' and current_tags %}
{% assign index = shop.metafields.AllTagsIndex.all_tags_index %}
{% if index == 'index' %}
{% assign indexing = 'index' %}
{% elsif index == 'noindex' %}
{% assign indexing = 'noindex' %}
{%else%}
{% assign indexing = 'index' %}
{% endif %}
{% assign tag_index_key = current_tags[0] | handleize | prepend: 'f_' %}
{% if collection.metafields.TagIndex[tag_index_key] == 'index' %}
{% assign indexing = 'index' %}
{% elsif collection.metafields.TagIndex[tag_index_key] == 'noindex' %}
{% assign indexing = 'noindex' %}
{%else%}
{% assign indexing = 'noindex' %}
{% endif %}
{%if request.path contains '+'%}
{%assign indexing = 'noindex'%}
{%endif%}
<meta name='robots' content='{{indexing}}'/>
{% assign tag_seo_desc_key = current_tags[0] | handleize | prepend: 'c_' %}
{% assign tag_seo_title_key = current_tags[0] | handleize | prepend: 'a_' %}
{% assign seo_title = collection.metafields.TagSeoTitleData[tag_seo_title_key] %}
{% assign page_description = collection.metafields.TagSeoDesc[tag_seo_desc_key] | strip_html %}
{% endif %}
{{ 'optimizenup.css' | asset_url | stylesheet_tag }}
<!-- End Optizen V2 -->

2) collection.liquid – In Templates

Add the below code in every collection template.

<!-- Optizen V2 -->
{% assign con_tent ='' %}
{% if template contains 'collection' and current_tags %}
{% assign tag_page_key = current_tags[0] | handleize| prepend: 'e_' %}
{% assign show_page = collection.metafields.TagShowContent[tag_page_key] %}
{% assign tag_desc_key = current_tags[0] | handleize | prepend: 'g_' %}

{% if show_page == 'all_pages' %}
{% assign con_tent = collection.metafields.TagData[tag_desc_key] %}
{% else %}
{% if current_page == 1 %}
{% assign con_tent = collection.metafields.TagData[tag_desc_key] %}
{% endif %}
{% endif %}
{% else %}
{% if collection.metafields.collectionlower.show_content == 'all_pages' %}
{% assign con_tent = collection.metafields.collectionlower.lowerdata %}
{% else %}
{% if current_page == 1 %}
{% assign con_tent = collection.metafields.collectionlower.lowerdata %}
{% endif %}
{% endif %}
{% endif %}
<div class='col_lower_main' style='width:100%'>
<div class='inner_lower_main' style='max-width:1170px;margin:0 auto;'>
{{con_tent}}
</div>
</div>

<!-- End Optizen V2 -->

3) collection-template.liquid – In Sections

If your theme collection template contains any section for description.

find (Cntrl + F)

 {% if collection.description != blank %}
<div class="rte">
{{ collection.description }}
</div>
{% endif %}

replace with

<!-- Optizen V2 -->
{% assign collectiopn_c = '' %}
{% if collection.description != blank %}
{% assign collectiopn_c = collection.description %}
{% endif %}
{% if template contains 'collection' and current_tags %}
{% assign tag_description_key = current_tags[0] | handleize | prepend: 'b_' %}
{% assign tag_description = collection.metafields.TagDescTitle[tag_description_key] %}
{% assign collectiopn_c = tag_description %}
{% endif %}
<div class="rte collection-description page-width">
{{collectiopn_c}}
</div>
<!-- End Optizen V2 -->

find


{{ collection.title }}

replace

<!-- Optizen V2 -->
{% if template contains 'collection' and current_tags %}
{% assign tag_desc_key = current_tags[0] | handleize | prepend: 'd_' %}
{{collection.metafields.TagTitleData[tag_desc_key]}}
{% else %}
{{ collection.title }}
{% endif %}
<!-- End Optizen V2 -->

4) social-meta-tags.liquid In Snippets

  • add the code below, at the  top of the file:

<!-- Optizen V2 -->
{% if template contains 'collection' and current_tags %}
{% assign tag_seo_title_key = current_tags[0] | handleize | prepend: 'a_' %}
{% assign tag_seo_desc_key = current_tags[0] | handleize | prepend: 'c_' %}
{% assign page_description = collection.metafields.TagSeoDesc[tag_seo_desc_key] | strip_html %}
{% assign page_title = collection.metafields.TagSeoTitleData[tag_seo_title_key] %}
{% endif %}
<!-- End Optizen V2 -->

If your theme does not contain these templates, sections and snippets, please submit a support ticket here.

Next How To Uninstall Optizen
Table of Contents