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

Add missing CTA tracking attributes #5574

Merged
merged 22 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions src/components/Blockquote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,28 @@ export const BlockquoteWithLogoBottom: FunctionComponent<{
)}
{link &&
(link.href.includes('http') ? (
<a href={link.href} target="_blank" rel="nofollow noreferrer">
<a
href={link.href}
target="_blank"
rel="nofollow noreferrer"
title={link.text}
data-button-style={buttonStyle.textWithArrow}
data-button-location={buttonLocation.body}
data-button-type="cta"
>
{link.text}
<ArrowRightIcon className="icon-inline ml-1" />
</a>
) : (
<Link href={link.href} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className="d-flex justify-content-center mt-3">
<a
className="d-flex justify-content-center mt-3"
href="#none"
st0nebreaker marked this conversation as resolved.
Show resolved Hide resolved
title={link.text}
data-button-style={buttonStyle.textWithArrow}
data-button-location={buttonLocation.body}
data-button-type="cta"
>
<p className="font-weight-bold">{link.text}</p>
<ArrowRightIcon className="icon-inline ml-1" />
</a>
Expand Down Expand Up @@ -110,15 +124,24 @@ export const BlockquoteWithBorder: FunctionComponent<{
))}
{link &&
(link?.href.includes('http') ? (
<a href={link.href} target="_blank" rel="nofollow noreferrer">
<a
href={link.href}
target="_blank"
rel="nofollow noreferrer"
title={link.text}
data-button-style={buttonStyle.textWithArrow}
data-button-location={buttonLocation.body}
data-button-type="cta"
>
{link.text}
<ArrowRightIcon className="icon-inline ml-1" />
</a>
) : (
<Link href={link.href} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a
className="d-flex justify-content-center mt-3"
href="#none"
title={link.text}
data-button-style={buttonStyle.textWithArrow}
data-button-location={buttonLocation.body}
data-button-type="cta"
Expand Down
5 changes: 3 additions & 2 deletions src/components/Blog/BlogHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ export const BlogHeader: FunctionComponent<Props> = ({ title, belowTitle, baseUr
<div>
<h1 className="display-4 font-weight-bold mt-3">
<Link href={baseUrl} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className="text-body">{title}</a>
<a className="text-body" href="#none">
{title}
</a>
</Link>
</h1>

Expand Down
5 changes: 3 additions & 2 deletions src/components/Blog/LinkPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ export const LinkPost: FunctionComponent<Props> = ({

<div className="card-footer bg-transparent border-top-0 pt-0">
<Link href={url} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className={`text-gray-5 ${titleLinkClassName}`}>{post.frontmatter.publishDate}</a>
<a className={`text-gray-5 ${titleLinkClassName}`} href="#none">
{post.frontmatter.publishDate}
</a>
</Link>
</div>
</Tag>
Expand Down
15 changes: 9 additions & 6 deletions src/components/Blog/PodcastListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,20 @@ export const PodcastListItem: FunctionComponent<PostIndexItemProps> = ({
<div className="flex-1">
<div>
<Link href={`/podcast/${slugPath}`} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className="text-muted mr-4 font-weight-bold">Permalink</a>
<a className="text-muted mr-4 font-weight-bold" href="#none" title="Permalink">
st0nebreaker marked this conversation as resolved.
Show resolved Hide resolved
Permalink
</a>
</Link>

<Link href={`/podcast/${slugPath}#notes`} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className="text-muted mr-4 font-weight-bold">Show notes</a>
<a className="text-muted mr-4 font-weight-bold" href="#none" title="Show notes">
Show notes
</a>
</Link>
<Link href={`/podcast/${slugPath}#transcript`} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className="text-muted mr-4 font-weight-bold">Transcript</a>
<a className="text-muted mr-4 font-weight-bold" href="#none" title="Transcript">
Transcript
</a>
</Link>
{frontmatter.videoID && (
<a
Expand Down
5 changes: 3 additions & 2 deletions src/components/Blog/PostLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ export const PostLayout: FunctionComponent<PostComponentProps> = ({
<h1 className={titleClassName}>
{renderTitleAsLink === true ? (
<Link href={url} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className={`d-block ${titleLinkClassName}`}>{post.frontmatter.title}</a>
<a className={`d-block ${titleLinkClassName}`} href="#none" title={post.frontmatter.title}>
{post.frontmatter.title}
</a>
</Link>
) : (
post.frontmatter.title
Expand Down
13 changes: 7 additions & 6 deletions src/components/Blog/PostListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export const PostListItem: FunctionComponent<PostIndexItemProps> = ({
<h1 className={titleClassName}>
{renderTitleAsLink === true ? (
<Link href={`/${blogType}/${slugPath}`} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className={`d-block ${titleLinkClassName}`}>{frontmatter.title}</a>
<a className={`d-block ${titleLinkClassName}`} href="#none" title={frontmatter.title}>
{frontmatter.title}
</a>
</Link>
) : (
frontmatter.title
Expand Down Expand Up @@ -71,16 +72,16 @@ export const PostListItem: FunctionComponent<PostIndexItemProps> = ({
)}
<div className="text-center text-sm-left">
<Link href={`/${blogType}/${slugPath}`} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className="font-weight-bold">Read more</a>
<a className="font-weight-bold" href="#none" title="Read more">
st0nebreaker marked this conversation as resolved.
Show resolved Hide resolved
Read more
</a>
</Link>
</div>
</div>

<div className="col-md-3 d-flex">
<Link href={`/${blogType}/${slugPath}`} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a>
<a href="#none">
<img
className="w-100"
src={
Expand Down
5 changes: 3 additions & 2 deletions src/components/Blog/ReleasePost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ export const ReleasePost: FunctionComponent<Props> = ({
<h1 className={titleClassName}>
{renderTitleAsLink === true ? (
<Link href={url} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className={`d-block ${titleLinkClassName}`}>{post.frontmatter.title}</a>
<a className={`d-block ${titleLinkClassName}`} href="#none">
{post.frontmatter.title}
</a>
</Link>
) : (
post.frontmatter.title
Expand Down
11 changes: 10 additions & 1 deletion src/components/BlogResourceItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { FunctionComponent } from 'react'

import { buttonStyle, buttonLocation } from '@data'

interface Props {
blog: Blog
}
Expand All @@ -20,7 +22,14 @@ interface Blog {
export const BlogResourceItem: FunctionComponent<Props> = ({ blog }) => (
<div className="w-100 row mx-0 mb-5 pb-4 border-bottom">
<div className="col-sm-8 col-md-9">
<a className="posts-list__post-title-link" href={blog.href}>
<a
className="posts-list__post-title-link"
href={blog.href}
title={blog.title}
data-button-style={buttonStyle.text}
data-button-location={buttonLocation.body}
data-button-type="cta"
>
<h3 className="font-weight-bold">{blog.title}</h3>
</a>
<p className="text-gray-5">{blog.type}</p>
Expand Down
25 changes: 22 additions & 3 deletions src/components/CaseStudies/CaseStudyCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { FunctionComponent } from 'react'
import classNames from 'classnames'
import Link from 'next/link'

import { buttonStyle, buttonLocation } from '@data'

import styles from './CaseStudyCard.module.scss'

interface CaseStudy {
Expand Down Expand Up @@ -119,13 +121,30 @@ export const CaseStudyCard: FunctionComponent<{ study: CaseStudy; bwLogo?: boole
{title}{' '}
<span className="text-nowrap">
{url.includes('http') ? (
<a href={url} className="card-link" target="_blank" rel="nofollow noreferrer">
<a
href={url}
className="card-link"
target="_blank"
rel="nofollow noreferrer"
title={linkText + ': ' + title}
data-button-style={buttonStyle.text}
data-button-location={buttonLocation.body}
data-button-type="cta"
>
{linkText}.
</a>
) : (
<Link href={url} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className="card-link">{linkText}.</a>
<a
className="card-link"
href="#none"
title={linkText + ': ' + title}
data-button-style={buttonStyle.text}
data-button-location={buttonLocation.body}
data-button-type="cta"
>
{linkText}.
st0nebreaker marked this conversation as resolved.
Show resolved Hide resolved
</a>
</Link>
)}
</span>
Expand Down
3 changes: 1 addition & 2 deletions src/components/CustomerLogos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ export const CustomerLogos: FunctionComponent = () => (
<div className="d-flex flex-wrap align-items-center justify-content-center max-w-1000 mx-auto user-select-none">
{logos.map((logo: Logo) => (
<Link key={logo.name} href={logo.link ? logo.link : '/case-studies'} passHref={true}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className="max-w-100 max-h-100 my-3 mx-4 flex-shrink-0">
<a className="max-w-100 max-h-100 my-3 mx-4 flex-shrink-0" href="#none">
<img
src={logo.src}
alt={`${logo.name} logo`}
Expand Down
1 change: 1 addition & 0 deletions src/components/FeatureWalkthrough/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export const FeatureWalkthrough: FunctionComponent = () => {
<a
className="btn btn-outline-primary mt-2"
href="#none"
title={'Learn more about ' + startCase(feature.productFeature)}
data-button-style={buttonStyle.outline}
data-button-location={buttonLocation.body}
data-button-type="cta"
Expand Down
1 change: 1 addition & 0 deletions src/components/Install/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const Install: FunctionComponent = () => {
<a
className="d-inline-block text-lg"
href="https://docs.sourcegraph.com"
title="Deploy to a server or cluster"
data-button-style={buttonStyle.text}
data-button-location={buttonLocation.trySourcegraph}
data-button-type="cta"
Expand Down
Loading