Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: UTM mobile #10665

Merged
merged 12 commits into from
Aug 13, 2024
8 changes: 4 additions & 4 deletions lib/ProductOpener/Config_obf.pm
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ $flavor = 'obf';
site_name => "Open Beauty Facts",
product_type => "beauty",
og_image_url => "https://world.openbeautyfacts.org/images/misc/openbeautyfacts-logo-en.png",
android_apk_app_link => "https://world.openbeautyfacts.org/images/apps/obf.apk",
android_app_link => "https://play.google.com/store/apps/details?id=org.openbeautyfacts.scanner",
ios_app_link => "https://apps.apple.com/app/open-beauty-facts/id1122926380",
facebook_page_url => "https://www.facebook.com/openbeautyfacts",
android_apk_app_link => "https://world.openbeautyfacts.org/images/apps/obf.apk?utm_source=obf&utf_medium=web",
android_app_link => "https://play.google.com/store/apps/details?id=org.openbeautyfacts.scanner&utm_source=obf&utf_medium=web",
ios_app_link => "https://apps.apple.com/app/open-beauty-facts/id1122926380?utm_source=obf&utf_medium=web",
facebook_page_url => "https://www.facebook.com/openbeautyfacts?utm_source=obf&utf_medium=web",
twitter_account => "OpenBeautyFacts",
);

Expand Down
8 changes: 4 additions & 4 deletions lib/ProductOpener/Config_off.pm
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ $flavor = 'off';
site_name => "Open Food Facts",
product_type => "food",
og_image_url => "https://static.openfoodfacts.org/images/logos/off-logo-vertical-white-social-media-preview.png",
android_apk_app_link => "https://world.openfoodfacts.org/files/off.apk",
android_app_link => "https://play.google.com/store/apps/details?id=org.openfoodfacts.scanner",
ios_app_link => "https://apps.apple.com/app/open-food-facts/id588797948",
facebook_page_url => "https://www.facebook.com/OpenFoodFacts",
android_apk_app_link => "https://world.openfoodfacts.org/files/off.apk?utm_source=off&utf_medium=web",
android_app_link => "https://play.google.com/store/apps/details?id=org.openfoodfacts.scanner&utm_source=off&utf_medium=web",
ios_app_link => "https://apps.apple.com/app/open-food-facts/id588797948?utm_source=off&utf_medium=web",
facebook_page_url => "https://www.facebook.com/OpenFoodFacts?utm_source=off&utf_medium=web",
facebook_page_url_fr => "https://www.facebook.com/OpenFoodFacts.fr",
twitter_account => "OpenFoodFacts",
twitter_account_fr => "OpenFoodFactsFr",
Expand Down
8 changes: 4 additions & 4 deletions lib/ProductOpener/Config_opf.pm
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ $flavor = "opf";
site_name => "Open Products Facts",
product_type => "products",
og_image_url => "https://world.openproductsfacts.org/images/misc/openproductsfacts-logo-en.png",
#android_apk_app_link => "https://world.openbeautyfacts.org/images/apps/obf.apk",
#android_app_link => "https://play.google.com/store/apps/details?id=org.openbeautyfacts.scanner",
#ios_app_link => "https://apps.apple.com/app/open-beauty-facts/id1122926380",
#facebook_page_url => "https://www.facebook.com/openbeautyfacts",
#android_apk_app_link => "https://world.openbeautyfacts.org/images/apps/obf.apk?utm_source=opf&utf_medium=web",
#android_app_link => "https://play.google.com/store/apps/details?id=org.openbeautyfacts.scanner&utm_source=opf&utf_medium=web",
#ios_app_link => "https://apps.apple.com/app/open-beauty-facts/id1122926380?utm_source=opf&utf_medium=web",
#facebook_page_url => "https://www.facebook.com/openbeautyfacts?&utm_source=opf&utf_medium=web",
#twitter_account => "OpenBeautyFacts",
);

Expand Down
6 changes: 3 additions & 3 deletions lib/ProductOpener/Config_opff.pm
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ $flavor = "opff";
product_type => "petfood",
og_image_url => "https://world.openpetfoodfacts.org/images/misc/openpetfoodfacts-logo-en.png",
#android_apk_app_link => "https://world.openbeautyfacts.org/images/apps/obf.apk",
#android_app_link => "https://play.google.com/store/apps/details?id=org.openbeautyfacts.scanner",
#ios_app_link => "https://apps.apple.com/app/open-beauty-facts/id1122926380",
#facebook_page_url => "https://www.facebook.com/openbeautyfacts",
#android_app_link => "https://play.google.com/store/apps/details?id=org.openbeautyfacts.scanner&utm_source=opff&utf_medium=web",
#ios_app_link => "https://apps.apple.com/app/open-beauty-facts/id1122926380?utm_source=opff&utf_medium=web",
#facebook_page_url => "https://www.facebook.com/openbeautyfacts?utm_source=opff&utf_medium=web",
#twitter_account => "OpenBeautyFacts",
);

Expand Down
17 changes: 12 additions & 5 deletions templates/web/common/site_layout.tt.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<li><a href="[% edq(lang('menu_contribute_link')) %]">[% lang('menu_contribute') %]</a></li>
<li class="divider"></li>
<li><label>[% lang("add_products") %]</label></li>
<!-- For reference: get_the_app_link_off" = /open-food-facts-mobile-app" -->
<li><a href="[% edq(lang_flavor('get_the_app_link')) %]?utm_source=off&utf_medium=web&utm_campaign=pro_platform_install_the_app_to_add_products_[% language %]">[% lang('install_the_app_to_add_products') %]</a></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li><a href="[% edq(lang_flavor('get_the_app_link')) %]?utm_source=off&utf_medium=web&utm_campaign=pro_platform_install_the_app_to_add_products_[% language %]">[% lang('install_the_app_to_add_products') %]</a></li>
<li><a href="[% edq(lang_flavor('get_the_app_link')) %]&utm_source=off&utf_medium=web&utm_campaign=pro_platform_install_the_app_to_add_products_[% language %]">[% lang('install_the_app_to_add_products') %]</a></li>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no question mark in the root URL, I believe @hangy

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_the_app_link is in po files @stephanegigandet @hangy

<li><a href="/cgi/product.pl?type=search_or_add&action=display">[% lang('add_product') %]</a></li>
[% ELSE %]
Expand Down Expand Up @@ -198,7 +199,8 @@
<li><a href="[% edq(lang('menu_contribute_link')) %]" class="top-bar-links">[% lang('menu_contribute') %]</a></li>
<li class="show-for-xlarge-up"><a href="[% edq(lang('footer_producers_link')) %]" class="top-bar-links">[% lang('footer_producers') %]</a></li>
<li class="flex-grid getapp"><a href="[% edq(lang_flavor('get_the_app_link')) %]?utm_source=off&utf_medium=web&utm_campaign=search_and_links_promo_[% language %]" class="buttonbar button" style="top:0;">[% display_icon('phone_android') %] <span class="bt-text">[% lang('get_the_app') %]</span></a></li>
</ul>
<!-- For reference: get_the_app_link_off" = /open-food-facts-mobile-app" -->
</ul>
</section>
[% END %]
</nav>
Expand Down Expand Up @@ -242,13 +244,15 @@
<!-- full width banner on mobile -->

[% IF mobile %]
<a href="[% mobile.link %]?utm_source=off&utf_medium=web&utm_campaign=mobile-app-top-banner-[% language %]" id="mobile-app-top-banner" class="button large expand success">
<!-- For reference: mobile.link = https://play.google.com/store/apps/details?id=org.openfoodfacts.scanner -->
<a href="[% mobile.link %]&utm_campaign=mobile-app-top-banner-[% language %]" id="mobile-app-top-banner" class="button large expand success">
<div class="row collapse">
<div class="small-6 columns">
[% mobile.text %]
</div>
<div class="small-6 columns">
[% IF mobile.system == "ios" %]
<!-- ios_app_icon_url = "/images/misc/appstore/black/appstore_US.svg" -->
<img src="[% edq(lang('ios_app_icon_url')) %]" alt="[% edq(lang('ios_app_icon_alt_text')) %]">
[% ELSIF mobile.system == "android" %]
<img src="[% edq(lang('android_app_icon_url')) %]" alt="[% edq(lang('android_app_icon_alt_text')) %]">
Expand Down Expand Up @@ -328,8 +332,11 @@ <h1 class="if-empty-dnone">[% title %]</h1>
</div>
</div>
<div class="cell small-100 medium-100 large-50 flex-grid v-align-center direction-row">
<a class="cell small-50 medium-25 large-25 h-space-short v-align-center" href="[% options.ios_app_link %]?utm_source=off&utf_medium=web&utm_campaign=install_the_app_ios_footer_[% language %]"><img src="[% edq(lang('ios_app_icon_url')) %]" alt="[% edq(lang('ios_app_icon_alt_text')) %]" loading="lazy" class="full-width"></a>
<a class="cell small-50 medium-25 large-25 h-space-short v-align-center" href="[% options.android_app_link %]?utm_source=off&utf_medium=web&utm_campaign=install_the_app_android_footer_[% language %]"><img src="https://static.openfoodfacts.org[% edq(lang('android_app_icon_url')) %]" alt="[% edq(lang('android_app_icon_alt_text')) %]" loading="lazy" class="full-width"></a>
<!-- msgid "https://apps.apple.com/app/open-beauty-facts/id1122926380" -->
<a class="cell small-50 medium-25 large-25 h-space-short v-align-center" href="[% options.ios_app_link %]&utm_campaign=install_the_app_ios_footer_[% language %]"><img src="[% edq(lang('ios_app_icon_url')) %]" alt="[% edq(lang('ios_app_icon_alt_text')) %]" loading="lazy" class="full-width"></a>
<!-- android_app_link - https://play.google.com/store/apps/details?id=org.openbeautyfacts.scanner&hl=en -->
<a class="cell small-50 medium-25 large-25 h-space-short v-align-center" href="[% options.android_app_link %]&utm_campaign=install_the_app_android_footer_[% language %]"><img src="https://static.openfoodfacts.org[% edq(lang('android_app_icon_url')) %]" alt="[% edq(lang('android_app_icon_alt_text')) %]" loading="lazy" class="full-width"></a>
<!-- android_apk_app_link - https://world.openfoodfacts.org/images/apps/off.apk -->
<a class="cell small-50 medium-25 large-25 h-space-short v-align-center" href="[% options.android_apk_app_link %]?utm_source=off&utf_medium=web&utm_campaign=install_the_app_apk_footer_[% language %]"><img src="https://static.openfoodfacts.org[% edq(lang('android_apk_app_icon_url')) %]" alt="[% edq(lang('android_apk_app_icon_alt_text')) %]" loading="lazy" class="full-width"></a>
</div>
</div>
Expand Down Expand Up @@ -497,4 +504,4 @@ <h3 class="title-5 text-medium">[% lang('footer_discover_the_project') %]</h3>
</body>
</html>

<!-- end templates/[% template.name %] -->
<!-- end templates/[% template.name %] -->
Loading