Spaces:
Build error
Build error
add sem/seo
#3
by notjulietxd - opened
- pages/output.py +71 -38
pages/output.py
CHANGED
|
@@ -4,45 +4,18 @@ import streamlit as st
|
|
| 4 |
from helper.data_field import get_analyst_response
|
| 5 |
import time
|
| 6 |
|
| 7 |
-
st.set_page_config(layout="centered")
|
| 8 |
|
| 9 |
-
def
|
| 10 |
-
|
| 11 |
-
overview = f"""**{client_name}** is a financial services company based in Auckland, New Zealand, specializing in providing quick and flexible loan solutions for businesses and individuals. Represented by Paul Stone, LoansOne has enlisted ShoreMarketing to perform a deep dive into their digital footprint to have a view of the holistic status of their digital properties and determine how each property can play part in implementing a stronger digital marketing plan.\n
|
| 12 |
-
The Digital Marketing Footprint consists of deep-dive research by ShoreMarketing specialists to help the business leaders of LoansOne understand the effectiveness of their existing digital initiatives with the view of giving them an insight to developing a strategy and effectively allocating business resources to digital properties that will give them the best results.\n
|
| 13 |
-
This document represents the results of our audit of LoansOne’s digital marketing and management practices. Our audit covered reviews of key digital areas: Website and Tools, PPC/SEM, SEO, Social Media, and Market Places."""
|
| 14 |
-
website_and_tools_data = get_analyst_response("Website and Tools Analyst")
|
| 15 |
-
# seo = data_field("SEO")
|
| 16 |
-
# social_media = data_field("Social Media")
|
| 17 |
-
|
| 18 |
-
# (off_page_thread)
|
| 19 |
-
# (on_page_thread)
|
| 20 |
-
# (website_and_tools_thread)
|
| 21 |
-
# (seo_thread)
|
| 22 |
-
# (social_media_thread)
|
| 23 |
-
st.markdown("## Digital Marketing Audit")
|
| 24 |
-
st.markdown(f"### {client_name}")
|
| 25 |
-
|
| 26 |
-
st.markdown("## DIGITAL FOOTPRINT OVERVIEW")
|
| 27 |
-
st.markdown(f"{overview}")
|
| 28 |
-
|
| 29 |
-
st.markdown("## WEBSITE AND TOOLS")
|
| 30 |
-
st.markdown(f"""In today’s digital age, scaling a business is simply impossible without a website. Websites primarily serve as the center for all online conversions, which makes it equally important to guarantee that all pages are optimised to educate all traffic about the brand and ultimately to usher them into conversion. \n
|
| 31 |
-
In line with this, we have looked into the technology used by **{client_name}** as well as the different digital channels currently in place to see how they are structured and how they are performing.""")
|
| 32 |
-
|
| 33 |
-
# --- Start: Loop and display data as Markdown table ---
|
| 34 |
if website_and_tools_data:
|
| 35 |
try:
|
| 36 |
-
|
| 37 |
-
# parsed_data = json.loads(website_and_tools_data)
|
| 38 |
-
|
| 39 |
-
# If get_analyst_response returns a Python list/dict directly:
|
| 40 |
parsed_data = website_and_tools_data
|
| 41 |
-
|
| 42 |
-
# Check if the parsed data is a list (expected format for a table)
|
| 43 |
if isinstance(parsed_data, list):
|
| 44 |
# Create Markdown table header
|
| 45 |
-
markdown_table = "|
|
| 46 |
markdown_table += "|---|---|---|\n"
|
| 47 |
|
| 48 |
# Loop through the list of dictionaries
|
|
@@ -66,26 +39,86 @@ In line with this, we have looked into the technology used by **{client_name}**
|
|
| 66 |
|
| 67 |
# Handle case if data is not a list (e.g., a single dictionary)
|
| 68 |
elif isinstance(parsed_data, dict):
|
| 69 |
-
st.write("
|
| 70 |
# You might want to display dictionary data differently
|
| 71 |
st.json(parsed_data) # Example: Display as JSON
|
| 72 |
else:
|
| 73 |
-
st.warning("
|
| 74 |
st.write(parsed_data) # Show the raw data
|
| 75 |
|
| 76 |
except json.JSONDecodeError:
|
| 77 |
-
st.error("Error: Could not parse the
|
| 78 |
st.text(website_and_tools_data) # Show the raw string data
|
| 79 |
except AttributeError:
|
| 80 |
st.error("Error: Could not find expected keys ('category', 'current_footprint', 'best_of_breed_solution') in the data.")
|
| 81 |
st.write(parsed_data) # Show the data that caused the error
|
| 82 |
except Exception as e:
|
| 83 |
-
st.error(f"An unexpected error occurred while processing
|
| 84 |
st.write(website_and_tools_data) # Show the raw data
|
| 85 |
else:
|
| 86 |
-
st.warning("No data retrieved for
|
| 87 |
# --- End: Loop and display data ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
|
|
|
| 89 |
|
| 90 |
if st.button("Back to Dashboard"):
|
| 91 |
st.switch_page("pages/home.py")
|
|
|
|
| 4 |
from helper.data_field import get_analyst_response
|
| 5 |
import time
|
| 6 |
|
| 7 |
+
st.set_page_config(layout="centered")
|
| 8 |
|
| 9 |
+
def write_table(website_and_tools_data):
|
| 10 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
if website_and_tools_data:
|
| 12 |
try:
|
| 13 |
+
|
|
|
|
|
|
|
|
|
|
| 14 |
parsed_data = website_and_tools_data
|
| 15 |
+
|
|
|
|
| 16 |
if isinstance(parsed_data, list):
|
| 17 |
# Create Markdown table header
|
| 18 |
+
markdown_table = "| | Current Footprint | Best of Breed Solution |\n"
|
| 19 |
markdown_table += "|---|---|---|\n"
|
| 20 |
|
| 21 |
# Loop through the list of dictionaries
|
|
|
|
| 39 |
|
| 40 |
# Handle case if data is not a list (e.g., a single dictionary)
|
| 41 |
elif isinstance(parsed_data, dict):
|
| 42 |
+
st.write("Analysis Result (Summary):")
|
| 43 |
# You might want to display dictionary data differently
|
| 44 |
st.json(parsed_data) # Example: Display as JSON
|
| 45 |
else:
|
| 46 |
+
st.warning("data is not in the expected list format.")
|
| 47 |
st.write(parsed_data) # Show the raw data
|
| 48 |
|
| 49 |
except json.JSONDecodeError:
|
| 50 |
+
st.error("Error: Could not parse the data as JSON.")
|
| 51 |
st.text(website_and_tools_data) # Show the raw string data
|
| 52 |
except AttributeError:
|
| 53 |
st.error("Error: Could not find expected keys ('category', 'current_footprint', 'best_of_breed_solution') in the data.")
|
| 54 |
st.write(parsed_data) # Show the data that caused the error
|
| 55 |
except Exception as e:
|
| 56 |
+
st.error(f"An unexpected error occurred while processing data: {e}")
|
| 57 |
st.write(website_and_tools_data) # Show the raw data
|
| 58 |
else:
|
| 59 |
+
st.warning("No data retrieved for analysis.")
|
| 60 |
# --- End: Loop and display data ---
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def display_outputs():
|
| 65 |
+
client_name = "RMX Creatives"
|
| 66 |
+
overview = f"""**{client_name}** is a financial services company based in Auckland, New Zealand, specializing in providing quick and flexible loan solutions for businesses and individuals. Represented by Paul Stone, LoansOne has enlisted ShoreMarketing to perform a deep dive into their digital footprint to have a view of the holistic status of their digital properties and determine how each property can play part in implementing a stronger digital marketing plan.\n
|
| 67 |
+
The Digital Marketing Footprint consists of deep-dive research by ShoreMarketing specialists to help the business leaders of LoansOne understand the effectiveness of their existing digital initiatives with the view of giving them an insight to developing a strategy and effectively allocating business resources to digital properties that will give them the best results.\n
|
| 68 |
+
This document represents the results of our audit of LoansOne’s digital marketing and management practices. Our audit covered reviews of key digital areas: Website and Tools, PPC/SEM, SEO, Social Media, and Market Places."""
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
st.markdown("# Digital Marketing Audit")
|
| 72 |
+
st.markdown(f"{client_name}")
|
| 73 |
+
st.write("")
|
| 74 |
+
st.write("")
|
| 75 |
+
st.write("")
|
| 76 |
+
st.markdown("### DIGITAL FOOTPRINT OVERVIEW")
|
| 77 |
+
st.markdown(f"{overview}")
|
| 78 |
+
st.markdown("---")
|
| 79 |
+
st.markdown("### Executive Summary")
|
| 80 |
+
st.markdown(f"Simtech LED's digital footprint reveals significant strengths and areas for improvement that can enhance its competitive positioning in the casino, gaming, and entertainment LED market. The analysis highlights the following key findings and recommendations")
|
| 81 |
+
st.markdown("---")
|
| 82 |
+
|
| 83 |
+
st.markdown("### CLIENT FOOTPRINT")
|
| 84 |
+
st.markdown(f"A")
|
| 85 |
+
st.markdown("---")
|
| 86 |
+
|
| 87 |
+
st.markdown("### SNAPSHOT BY CHANNEL")
|
| 88 |
+
st.markdown(f"A")
|
| 89 |
+
st.markdown("---")
|
| 90 |
+
|
| 91 |
+
st.markdown("## AUDITS PER CHANNEL")
|
| 92 |
+
st.markdown("### WEBSITE AND TOOLS")
|
| 93 |
+
st.markdown(f"""In today’s digital age, scaling a business is simply impossible without a website. Websites primarily serve as the center for all online conversions, which makes it equally important to guarantee that all pages are optimised to educate all traffic about the brand and ultimately to usher them into conversion. \n
|
| 94 |
+
In line with this, we have looked into the technology used by **{client_name}** as well as the different digital channels currently in place to see how they are structured and how they are performing.""")
|
| 95 |
+
|
| 96 |
+
# Write W&T Table
|
| 97 |
+
website_and_tools_data = get_analyst_response("Website and Tools Analyst")
|
| 98 |
+
write_table(website_and_tools_data)
|
| 99 |
+
|
| 100 |
+
st.markdown("---")
|
| 101 |
+
|
| 102 |
+
st.markdown("### SEARCH ENGINE MARKETING/PPC")
|
| 103 |
+
st.markdown(f"""Search engine marketing, or SEM, is one of the most effective ways to grow a business in an increasingly competitive industry such as solar energy. This is one of the easiest way to be seen by the market almost instantly - but with the certain cost per user clicks. \n
|
| 104 |
+
With several businesses out there all vying for the same eyeballs, it’s never been more important to advertise online, and search engine marketing is the most effective way to promote need-based, high-investment products and services such as solar energy services.\n
|
| 105 |
+
Currently, {client_name} has already explored numerous online advertising. Its competitors are also experienced in PPC in multiple platforms. """)
|
| 106 |
+
|
| 107 |
+
# Write W&T Table
|
| 108 |
+
sem_data = get_analyst_response("SEM PPC Analyst")
|
| 109 |
+
write_table(sem_data)
|
| 110 |
+
|
| 111 |
+
st.markdown("---")
|
| 112 |
+
|
| 113 |
+
st.markdown("### SEARCH ENGINE OPTIMIZATION")
|
| 114 |
+
st.markdown(f"""The purpose of Search Engine Optimization (SEO) is to strategically rearrange the website’s pages, attributes, content, and structure so that the website appears as high as possible in the results list displayed by search engines like Google, Bing, and Yahoo! when certain queries are entered by an internet user. Since high ranking positions are generally earned and worked for, ranking on the first page promotes trust between you and the search engine as well as to ultimately receive organic visibility with your users.\n
|
| 115 |
+
There are two types of SEO based on where the optimization is implemented: On-page SEO (which refers to any type of optimization done within the website) and Off-page SEO (which is often called Link Building or Link Acquisition – the process of getting more “votes” for the website through other domains). Both are essential in increasing a website’s visibility in search results pages and in ranking for more business-related keywords. """)
|
| 116 |
+
|
| 117 |
+
# Write W&T Table
|
| 118 |
+
seo_data = get_analyst_response("SEO Analyst")
|
| 119 |
+
write_table(seo_data)
|
| 120 |
|
| 121 |
+
st.markdown("---")
|
| 122 |
|
| 123 |
if st.button("Back to Dashboard"):
|
| 124 |
st.switch_page("pages/home.py")
|