Skip to content

update refer links to other docs with utm_source#317

Merged
alaeddine-13 merged 4 commits intomainfrom
docs-add-source-query-to-links
May 5, 2022
Merged

update refer links to other docs with utm_source#317
alaeddine-13 merged 4 commits intomainfrom
docs-add-source-query-to-links

Conversation

@Roshanjossey
Copy link
Copy Markdown
Contributor

Goals:

  • Track visits from docarray to other docs in jina eco-system

@Roshanjossey Roshanjossey force-pushed the docs-add-source-query-to-links branch from ef8ff42 to 0bed921 Compare May 1, 2022 23:27
@codecov
Copy link
Copy Markdown

codecov bot commented May 1, 2022

Codecov Report

Merging #317 (6ff80f8) into main (da703b0) will decrease coverage by 0.07%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #317      +/-   ##
==========================================
- Coverage   86.29%   86.22%   -0.08%     
==========================================
  Files         134      134              
  Lines        6312     6314       +2     
==========================================
- Hits         5447     5444       -3     
- Misses        865      870       +5     
Flag Coverage Δ
docarray 86.22% <100.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
docarray/__init__.py 100.00% <100.00%> (ø)
docarray/array/storage/weaviate/find.py 89.74% <100.00%> (ø)
docarray/array/mixins/plot.py 62.92% <0.00%> (-1.72%) ⬇️
docarray/array/storage/qdrant/backend.py 95.78% <0.00%> (-0.99%) ⬇️
docarray/helper.py 76.66% <0.00%> (-0.84%) ⬇️
docarray/document/mixins/plot.py 77.48% <0.00%> (-0.15%) ⬇️
docarray/array/mixins/post.py 87.50% <0.00%> (ø)
docarray/array/mixins/io/pushpull.py 87.23% <0.00%> (ø)
docarray/array/mixins/parallel.py 66.66% <0.00%> (+2.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e2f70e...6ff80f8. Read the comment docs.

Copy link
Copy Markdown
Contributor

@alexcg1 alexcg1 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@alaeddine-13
Copy link
Copy Markdown
Member

@Roshanjossey I don't think this is a sustainable way to add the query string parameter to clicked links. We can easily forget to add it on existing or new links. In order to give reliable information, is it possible to modify the website so that it adds utm_source=docarray to all the clicked links ? for example https://blog.miguelbernard.com/how-to-dynamically-add-a-query-string-to-all-links-in-a-page

@Roshanjossey
Copy link
Copy Markdown
Contributor Author

@alaeddine-13, good point. I've made that change

url.searchParams.set("utm_source", "docarray");
return url.href
}
catch{}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe just return href in the catch clause ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Catch block is executed only if there's an error in try block. If there are no errors, nothing will be returned from that function

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no the logic is, attempt to add utm source to link, otherwise if failed (catch block), keep it as it is (return href as it is)

@alaeddine-13
Copy link
Copy Markdown
Member

@alaeddine-13, good point. I've made that change

Thanks, I just added small comments. Is it possible to apply this logic to other PRs that target other documentation websites if there are any ? Thanks

@Roshanjossey Roshanjossey force-pushed the docs-add-source-query-to-links branch from 5f29b28 to 5554a05 Compare May 4, 2022 09:32
@Roshanjossey
Copy link
Copy Markdown
Contributor Author

@alaeddine-13, I'm made changes you suggested. I'll do the same with other docs.

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 5, 2022

📝 Docs are deployed on https://ft-docs-add-source-query-to-links--jina-docs.netlify.app 🎉

@alaeddine-13 alaeddine-13 merged commit 47e0a7c into main May 5, 2022
@alaeddine-13 alaeddine-13 deleted the docs-add-source-query-to-links branch May 5, 2022 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants